Programming note: WS_EX_TOPMOST

This posting is of historical interest. It exists to help other programmers who may come across a similar problem.

When you move your mouse over a disabled (grey) menu item, Cardbox tells you why it’s disabled:

Illustration of help for disabled command

On CrossOver Mac, the yellow explanatory window hid behind the main Cardbox window and couldn’t be seen.

The cause turns out to be the way that Wine handles the WS_EX_TOPMOST attribute. If a window is invisible and has WS_EX_TOPMOST, and you then make it visible, Windows displays it as a topmost window and Wine doesn’t (although WS_EX_TOPMOST remains set).

The cure is to use SetWindowPos(,HWND_TOPMOST,...) to force the window to be a topmost one after you have made it visible.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: