How to know if a specific style is present in a control?

Just starting out? Need help? Post your questions and find answers here.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

How to know if a specific style is present in a control?

Post by ricardo »

Hi,

Im trying to get the type and style of controls in foreign applications, how can i know from a GetWindowLong_(Handle, #GWL_STYLE) return if a style is present or not.

Per example, i notice that checkboxes & radiobuttons have the button as class name, but if i check the different buttons, radio and checkboxes in a window, usually their are not the same. I mean: not all the buttons has the same style, alomost every radio or checkbox (even on the same application) has different styles.

I made some kind of APY SPY that gives me the handl and style of every control that is under the mouse pointer and open, per example the explorer settings window that has many buttons, radio and checkboxes and i saw that not all the radios or checkboxes or buttons has the same style no matter that they seams to be identical.

Then, i want to know, per example, if one specific style are present in one control:

Result = GetWindowLong_(Handle, #GWL_STYLE)

How can i know if this result contains one specific style?
ARGENTINA WORLD CHAMPION
Fred
Administrator
Administrator
Posts: 18351
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Just use the '&' operator:

Code: Select all

If Style & #WS_CHILD
  ; It's a child !
EndIf
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Thanks Fred :D
ARGENTINA WORLD CHAMPION
Post Reply