unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
Var
hw: HWND;
begin
hw:= FindWindow('Shell_TrayWnd', nil);
if hw <> 0 then
begin
if (GetWindowLong(hw, GWL_EXSTYLE) and WS_EX_TOPMOST) <> 0 then
begin
if MessageDlg('ÀÛ¾÷Ç¥½ÃÁÙÀÌ ÇöÀç "Ç×»ó À§"·Î ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù'+#13#10+
'¼³Á¤À» ÇØÁ¦ÇϽðڽÀ´Ï±î ?',
mtConfirmation,[mbYes,mbNo],0) = mrYes then
SetWindowPos(hw, HWND_NOTOPMOST, 0,0,0,0, 0);
end
else
begin
if MessageDlg('ÀÛ¾÷Ç¥½ÃÁÙÀÌ ÇöÀç "Ç×»ó À§"·Î ¼³Á¤µÇÁö ¾Ê¾Ò½À´Ï´Ù'+#13#10+
'Ç×»ó À§·Î ÇϽðڽÀ´Ï±î ?',
mtConfirmation,[mbYes,mbNo],0) = mrYes then
SetWindowPos(hw, HWND_TOPMOST, 0, 0, 0,0,
SWP_NOACTIVATE or SWP_NOSIZE or SWP_NOMOVE);
end
end;
end;
end. |
|