News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

HWND_TOPMOST

Started by msmith, May 02, 2006, 05:15:42 AM

Previous topic - Next topic

msmith

If I do a SetWindowsPos with HWND_TOPMOST as the hWndInsertAfter param, I would expect that window to be visible "over" a window behind it. The window it is over has not been given HWND_TOPMOST.

What is the proper way to make a window "come to the top"?

Ossa

Hi,

according to the reference material, you should be using SetForegroundWindow to bring a non-active window to the top of the Z-order. Almost every other function will do nothing if the window is not active. However, in a quick test that I just ran, although it does more than almost every other function, it only makes the taskbar "button" flash. Maybe it might work if you use it in conjunction with SetWindowPos.

Hope that helps a little at least,
Ossa
Website (very old): ossa.the-wot.co.uk

msmith

Hi Ossa,

From what I can tell, SetForegroundWindow has to do with the window itself. When I spoke of window, I was referring to a control.

I just want to bring a particular control of my choosing to the "top" (visible over any control that might be in the same place).

Tedd

I don't think it's safe to assume or meedle with the z-order of child controls.
What you should do is hide all of the other controls 'under' it, and only show the control you want 'on-top'.
(use ShowWindow)
No snowflake in an avalanche feels responsible.

Shantanu Gadgil

If the concerned controls are created using an rc file (and not CreateWindow) then the TabIndex property (order of creation actually) would be important.

The lower (in the file) the control in the creation order, the more "above" it is with respect to the previous entries in the resource script.

OK...after reading what I have just typed, I am confused myself...so an example...
---
CONTROL 1
CONTROL 2
CONTROL 3
---
Here Control 3 will be "above" CONTROL 2 (assuming they have some common area)
To ret is human, to jmp divine!

msmith

#5
Tedd,

I cannot hide the other parts because the application is a "draw your GUI" WYSIWYG IDE. The particular controls I need to bring to the top are the 9 pieces of the "handles" that are used to position and size the components.

shantanu_gadgil,

All of my controls are created with CreateWindowEX.

Thanks,
Mike




msmith

I have found a temporary but hardly acceptable fix to my problem.

If I destroy the 8 ears (or handles or grips) and then recreate them each time they are used, they always "come to the top" like I want them to.
Surely there is a better way.

How I can I do this without destroying and recreating them?