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.
카테고리 없음