Page 1 of 1

SendToBack()

Posted: Tue Dec 28, 2010 1:04 pm
by Waussie
With the function

SetActiveWindow(#Window)

you can make a window active and get it on top of other windows.
Now I'd like to figure out what the layers are. (Which windows is on top and at the back and manage it.)

For a program I'm writing I need to know which one is the least on top. Or set the one least on top.

Is there a comment like SendToBack() or something? And with what syntax?

Re: SendToBack()

Posted: Tue Dec 28, 2010 1:11 pm
by netmaestro
On windows:

Code: Select all

SetWindowPos_(hwnd, #HWND_BOTTOM,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)

Re: SendToBack()

Posted: Tue Dec 28, 2010 3:48 pm
by Waussie
So I created this code, and expected the calculator window to move to the back, but it didn't.
What am I doing wrong here?

hwnd=0
While hwnd=0
hWnd = FindWindow_(#Null, @"Calculator")
Wend
SetWindowPos_(hWnd, #HWND_BOTTOM,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)

Re: SendToBack()

Posted: Tue Dec 28, 2010 4:04 pm
by netmaestro
If it isn't your window, you have to set it to the foreground first. Try this one:

Code: Select all

hwnd=0
While hwnd=0
hWnd = FindWindow_(#Null, "Calculator")
Wend
SetForegroundWindow_(hwnd)
SetWindowPos_(hWnd, #HWND_BOTTOM,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)

Re: SendToBack()

Posted: Tue Dec 28, 2010 4:18 pm
by Waussie
Thank you, it works !