Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi if GetWindowLong ... (https://www.delphipraxis.net/83434-if-getwindowlong.html)

Neutral General 2. Jan 2007 20:04


if GetWindowLong ...
 
Hi,

Wie überprüft man ob ein Flag gesetzt ist bei dem was man bei GetWindowLong zurückbekommt?

Delphi-Quellcode:
if GetWindowLong(wnd,GWL_EXSTYLE) or WS_EX_APPWINDOW = WS_EX_APPWINDOW then
...
eigentlich so oder?
Ich glaub bei mir geht das nicht so richtig -.-

Gruß
Neutral General

Muetze1 2. Jan 2007 20:06

Re: if GetWindowLong ...
 
Ersetz OR mit AND

Neutral General 2. Jan 2007 20:09

Re: if GetWindowLong ...
 
ja hab ich auch schon versucht...

Delphi-Quellcode:
if (IsWindow(i)) and
   (GetWindowLong(i,GWL_EXSTYLE) and WS_EX_APPWINDOW = WS_EX_APPWINDOW) then
   begin
     mIcon.Handle := SendMessage(i,WM_GETICON,WPARAM(TRUE),0);
     if mIcon.Handle <> 0 then
     begin
      ..... //hierhin komme ich nie! ohne GetWindowLong schon...
Und wenn ein Fenster WS_EX_APPWINDOW ist hats doch normal auch ein Icon oder? -.-

Christian Seehase 2. Jan 2007 21:13

Re: if GetWindowLong ...
 
Moin Michael,

kommst Du denn überhaupt zur SendMessage-Zeile?

Ausserdem solltest Du die vordefinierten Konstanten für wparam benutzen (ICON_BIG (1), ICON_SMALL (0) oder unter XP ICON_SMALL2 (2)).
Das wparam(true) funktioniert hat ist wohl eher als Zufall anzusehen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:39 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz