![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Dec 2007
Posts: 93
Rep Power: 1
![]() |
Sup guys,
When you do retrieve a window's information using GetWindowInfo, how do you check to see if a window has the style WS_OVERLAPPED? Thanks. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,206
Rep Power: 5
![]() |
Re: GetWindowInfo -
Your first step to find an answer is to think for yourself rather than trying to get other people to do the thinking for you. Your second step is RTFM.
|
|
|
|
|
|
#3 | |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 529
Rep Power: 4
![]() |
Re: GetWindowInfo -
Quote:
|
|
|
|
|
|
|
#4 |
|
12 years old
Join Date: Nov 2007
Posts: 80
Rep Power: 1
![]() |
Re: GetWindowInfo -
Wow, Ancient Dragon for Win32 Wiz.
__________________
iload_0 iconst_1 ishl or iload_0 iconst_2 idiv or iload_0 iconst_2 iconst_1 imul idiv [1] & [2] use the smallest stack size |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Dec 2007
Posts: 93
Rep Power: 1
![]() |
Re: GetWindowInfo -
Thanks for your posts! Could someone please explain how the operator & works? Also could Grumpy please tell me what the abbreviation stands for?
Thanks. |
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
Re: GetWindowInfo -
PcBrain, I hate to say it like this, but a lot of these questions you could be finding answers to more quickly by doing your own research. The
& operator is called the bitwise 'and' operator, and it evaluates the 'and' of each bit.00110101 & 01010011 = 00010001 This can be used to quickly determine whether or not a bit is set. For instance, if x can contain any integer value, and we want to see if the third bit in x is set:x = 13 // 13 is 00001101 y = x & 4 // 4 is 00000100 y is 1 (True) So in the context of window styles... I believe each style is represented by a different bit, and you can use a constants to isolate the bit for the style that the constant represents. Last edited by Sane; Jan 19th, 2008 at 10:50 AM. |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Dec 2007
Posts: 93
Rep Power: 1
![]() |
Re: GetWindowInfo -
Ahh, I see.
So something like the following should return true right? - ...
GetWindowInfo(hwnd, &WNDI);
...
if((WNDI.dwStyle & WS_OVERLAPPED) == true)
{
...
}
...Thanks. |
|
|
|
|
|
#8 |
|
12 years old
Join Date: Nov 2007
Posts: 80
Rep Power: 1
![]() |
Re: GetWindowInfo -
yuck.
if (WNDI.dwStyle & WS_OVERLAPPED) {
...
}
__________________
iload_0 iconst_1 ishl or iload_0 iconst_2 idiv or iload_0 iconst_2 iconst_1 imul idiv [1] & [2] use the smallest stack size |
|
|
|
|
|
#9 | |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 529
Rep Power: 4
![]() |
Re: GetWindowInfo -
Quote:
|
|
|
|
|
|
|
#10 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
Re: GetWindowInfo -
My mistake, I probably threw off the op when I said:
y is 1 (True)(It was supposed to be y is 4 (True) as well...)In my example, the only reason I said 'True' is because it gives some meaning to the arbitrary value of 4. In a coding scenario, I agree that it's more readable to neglect the '== true'. Sorry about the confusion. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|