Question:
Is it possible to disable the close button of any given Window?
Answer:
Yes, the following example disables the close button (and close option from the system menu) of the given Window.
procedure TForm1.Button1Click(Sender: TObject);
var
hwndHandle : THANDLE;
hMenuHandle : HMENU;
begin
hwndHandle := FindWindow(nil, 'Untitled - Notepad');
if (hwndHandle <> 0) then begin
hMenuHandle := GetSystemMenu(hwndHandle, FALSE);
if (hMenuHandle <> 0) then
DeleteMenu(hMenuHandle, SC_CLOSE, MF_BYCOMMAND);
end;
end;
Loading
Senin, 04 Juli 2011
Disabling close button of a window
Diposting oleh
iwan RFID
di
Senin, Juli 04, 2011
Kirimkan Ini lewat Email
BlogThis!
Bagikan ke X
Berbagi ke Facebook
Label:
Delphi
0 komentar:
Posting Komentar