May 11, 2024, 10:15:28 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


get the window styles?

Started by fasecero, December 29, 2008, 12:04:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fasecero

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.

Ionic Wind Support Team

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.
Ionic Wind Support Team

fasecero