You could AND the value you want to test for against the value returned -
if ((GetWindowLong(hwnd,GWL_EX_STYLE) & WS_EX_APPWINDOW) == WS_EX_APPWINDOW)
Kev.
----- Original Message -----
From: dx FX <vin...@ed...>
To: Dev-C++ mailing list <dev...@li...>
Sent: Friday, November 30, 2001 6:05 AM
Subject: RE: Re: [Dev-C++] Win32 shell programming
> Ok I did some researching on what you said... and I found out that I could
retrieve window styles as well as extended styles by using
GetWindowLong(HWND hwnd, int nIndex) which returns long. However I also
remember that window styles(as well as extended ones) can be combined by a
"|". No wonder the following statement(s) would return false for any values
of hwnd passed through EnumWindowsProc when I call EnumWindows:
>
> BOOL IsAppWindow(HWND hwnd) {
> if (GetWindowLong(hwnd,GWL_EX_STYLE)==WS_EX_APPWINDOW) {
>
> return true;
>
> } else {
>
> return false;
>
> }
> }
>
> Did I do something wrong? If there is, please tell me. The function is
supposed to detect if a handle refers to a window with the WS_EX_APPWINDOW
style. Note the word WITH which not necesarilly means "ONLY". So how do I
get around this problem?
>
> Note:
> I have Dev-C++ and Win32 help up and running on my computer while I was
running the program with the afformentioned function. I tried to count the
number of windows with WS_EX_APPWINDOW extended style. But I always end up
with 0. I'm expecting to get an output of greater than 0. How do I get
around this problem?
>
> __________________________________
> www.edsamail.com
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|