// ¾Æ·¡ ¼Ò½º´Â Ctrl-Alt-Del, Alt-Tab, Ctrl-Esc ÀÔ·ÂÀ» ¸·°í Ǫ´Â ¼Ò½ºÀÔ´Ï´Ù
// ¶ÇÇÑ "½ÃÀÛ" ¹öưÀ» ȸ鿡 ³ªÅ¸³ªÁö ¾Ê°Ô Çϰųª ¶Ç´Â Disabled ½ÃŰ´Â
// ·çƾµµ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure DlsableStartButton(Force: Boolean);
begin
if Force then
EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd',nil),0,'Button',nil), False)
else
EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd',nil),0,'Button',nil), True);
end;
procedure hideStartbutton(visi: boolean);
var
Tray, Child: HWnd;
c: array [0..127] Of Char;
s: String;
Begin
// À©µµ¿ìÁî task bar ÀÇ ÇÚµéÀ» ã´Â´Ù
Tray := FindWindow('Shell_TrayWnd', nil);
// task barÀÇ childµé Áß¿¡¼ button ÇÚµéÀ» ã´Â´Ù
Child := GetWindow(Tray, GW_CHILD); // task barÀÇ child ÇÚµéÁß Çϳª¸¦ ¸®ÅÏ
while Child <> 0 Do
begin
// windowsÀÇ Å¬·¡½º¸íÀ» ±¸Çؼ Button À̸é...
if GetClassName(Child, c, SizeOf(c)) > 0 Then
Begin
s := StrPas(c);
if UpperCase(s) = 'BUTTON' Then
begin
if visi Then
ShowWindow(Child, 1) // º¸À̱â
else
ShowWindow(Child, 0); // °¨Ãß±â
end;
end;
// ¸¸¾à Button À©µµ¿ì¸¦ ãÁö ¸øÇϸé sibling À©µµ¿ì¸¦ ã´Â´Ù
Child := GetWindow(Child, GW_HWNDNEXT);
end
end;
procedure TForm1.Button1Click(Sender: TObject);
var
dummy : integer;
begin
SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, @dummy, 0);
// "½ÃÀÛ" ¹öư °¨Ãß±â
hideStartbutton(False);
// "½ÃÀÛ" ¹öư Disable
// DlsableStartButton(True);
end;
procedure TForm1.Button2Click(Sender: TObject);
var
dummy : integer;
begin
SystemParametersInfo(SPI_SCREENSAVERRUNNING, 0, @dummy, 0);
// "½ÃÀÛ" ¹öư º¸À̱â
hideStartbutton(True);
// "½ÃÀÛ" ¹öư Enable
// DlsableStartButton(False);
end;
end. |
|