IonicWind Software

IWBasic => GUI Central => Topic started by: fasecero on December 29, 2008, 12:04:35 PM

Title: get the window styles?
Post by: fasecero on December 29, 2008, 12:04:35 PM
If I wanted to know the styles applied to a window I can use:   
   dwStyle=_GetWindowLong(w1.hwnd,GWL_STYLE)   
   
but dwStyle would be in the way:   
   dwStyle = style1 | style2 | style3 ...   
   
Is there some way to find these values individually?
Ty.
Title: Re: get the window styles?
Post by: Ionic Wind Support Team on December 29, 2008, 12:12:50 PM
Just use a bitwise AND.

if dwstyle & WS_BORDER
'border is part of the styles.
endif

Because Microsoft does some slight of hand with style bits, I usually do an & with a compare:

if (dwstyle & WS_BORDER) = WS_BORDER
'border is part of the styles.
endif

Which is especially important with button control styles.  Button control styles reuse style bits and are not powers of 2 like most other window styles. 

Paul.
Title: Re: get the window styles?
Post by: fasecero on December 29, 2008, 12:26:04 PM
Thank you!