SendToBack()

Just starting out? Need help? Post your questions and find answers here.
Waussie
User
User
Posts: 24
Joined: Fri Nov 11, 2005 12:14 pm

SendToBack()

Post 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?
Currently coding the unbelievable WFS program...
You'll know it, when it gets released...
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: SendToBack()

Post by netmaestro »

On windows:

Code: Select all

SetWindowPos_(hwnd, #HWND_BOTTOM,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)
BERESHEIT
Waussie
User
User
Posts: 24
Joined: Fri Nov 11, 2005 12:14 pm

Re: SendToBack()

Post 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)
Currently coding the unbelievable WFS program...
You'll know it, when it gets released...
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: SendToBack()

Post 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)
BERESHEIT
Waussie
User
User
Posts: 24
Joined: Fri Nov 11, 2005 12:14 pm

Re: SendToBack()

Post by Waussie »

Thank you, it works !
Currently coding the unbelievable WFS program...
You'll know it, when it gets released...
Post Reply