Vali Rosca
Vali Rosca

Reputation: 438

Multiple windows styles

Until now I have done console programming with C++ so I'm new to window programming and, it may sound like a stupid question but how do I use multiple window styles or extended window styles in a C++ Win32 App.? Let's say i want to use WS_EX_CONTEXTHELP, WS_EX_LEFTSCROLLBAR and WS_HSCROLL all in the same window.

Sorry if I haven't made myself clear or bad grammar.

Upvotes: 0

Views: 923

Answers (2)

IInspectable
IInspectable

Reputation: 51395

If you want to use extended window styles you need to call CreateWindowEx (vs. CreateWindow). Window styles - like all other flags - can be combined using the Bitwise Inclusive OR Operator: |

HWND hWnd = CreateWindowEx(WS_EX_CONTEXTHELP | WS_EX_LEFTSCROLLBAR,
                           ...,
                           WS_HSCROLL,
                           ...);

Upvotes: 1

Leo Chapiro
Leo Chapiro

Reputation: 13984

This flags can be combined by using the binary-or operator like this (if that is what you mean):

WS_EX_TOPMOST | WS_EX_LEFTSCROLLBAR

etc.

Upvotes: 4

Related Questions