Einzelnen Beitrag anzeigen

Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#13

Re: Fremder Anwendung einen Systemneustart vortäuschen?

  Alt 10. Feb 2006, 19:34
Zitat von Christian Seehase:
wenn ich mich richtig erinnere hatte ich mal ein Problem mit WM_CLOSE, und die Verwendung von WM_SYSCOMMAND mit SC_CLOSE hatte funktioniert [...]
Jupp, wenn das Program explizit auf SC_CLOSE Reagiert...

Delphi-Quellcode:
programm Schwupps;

function AppDlgProc(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Integer; stdcall;
begin

  if wParam = SC_CLOSE then
  begin
    EndDialog(hWnd, 1);
  end;

  case msg of
    WM_INITDIALOG: ; // ...
    WM_CLOSE: ; // Nix
  end;
  
  Result := 0;
end;

begin
  DialogBoxParam(hInstance, MAKEINTRESOURCE(ID_MYDIALOG), 0, @AppDlgProc, 0);
end.
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat