Einzelnen Beitrag anzeigen

youuu

Registriert seit: 2. Sep 2008
Ort: Kleve
822 Beiträge
 
Delphi 2010 Professional
 
#10

AW: 64bit SC_CLOSE?

  Alt 14. Aug 2010, 14:06
Selbst POSTMESSAGE tut einfach nichts :/

Delphi-Quellcode:
function FindWindowByTitle(WindowTitle: string): Hwnd;
var
  NextHandle: Hwnd;
  NextTitle: array[0..260] of char;
begin
  // Get the first window
  NextHandle := GetWindow(Application.Handle, GW_HWNDFIRST);
  while NextHandle > 0 do
  begin
    // retrieve its text
    GetWindowText(NextHandle, NextTitle, 255);
    if Pos(WindowTitle, StrPas(NextTitle)) <> 0 then
    begin
      Result := NextHandle;
      Exit;
    end
    else
      // Get the next window
      NextHandle := GetWindow(NextHandle, GW_HWNDNEXT);
  end;
  Result := 0;
end;

Delphi-Quellcode:
var
  h: hwnd;
begin
  h := FindWindowByTitle('Windows-Sicherheitswarnung');
  if (h <> 0) then // if we found
    POSTMESSAGE(h, WM_SYSCOMMAND, SC_CLOSE, 0);
end;
Diese Meldung ist erscheint leider jedesmal wenn ich auf eine bestimmte Domain gehe, obwohl diese normalerweise nicht erscheinen dürfte, aber darum geht es nicht.

Auf einen 32Bit Windows 7 schließt sich die Nachricht korrekt, nur auf einen Windows Server WEB 64Bit passiert rein gar nicht, allerdingsfinden tut er das Handle schon.
Steven

Geändert von youuu (14. Aug 2010 um 14:09 Uhr)
  Mit Zitat antworten Zitat