How to set a GUI to be " Always @ Bottom " ?
http://www.autohotke...p?p=54403#54403
I might be technically incorrect - but in layman terms,
"Always On Top" window will never be below any other window - and
"Always At Bottom" window will never be above any other window
because its a "Child window" of the Desktop.
The "sticking of the GUI" is achieved by a DllCall to User32.dll function "SetParent"
which sets the GUI to be the child window of Desktop.
Reference / Credits
Well. I was never comfortable with DllCall(), but for evl & Serenity ( & others ) who helped me to understand this
particular function on Ask for Help topic : Is there a way to write "Text" on Desktop, above Wallpaper ?
You may view Serenity's Post.
evl has posted it in Script & Functions titled : SetParent function (make a gui belong to another window).
I was hesitant in posting this but I had already written a demo ...
Always @ Bottom - How to ?
Add the following line immediately after Gui, ShowWinSet:=AlwaysAtBottom(WinExist("A"))
and include the AlwaysAtBottom() function in your scriptAlwaysAtBottom(Child_ID) { WinGet, Desktop_ID, ID, ahk_class Progman Return DllCall("SetParent", "uint", Child_ID, "uint", Desktop_ID) }
and thats it ....
The use?
You can make a GUI - a ToolWindow - without a Title bar - exactly the size of your desktop -
make this GUI always @ bottom - add small pictures to it - associate programs to these pictures
with gLabel - and what not ? This GUI will not be minimizeable and desktop will not be accessible
till this GUI is closed. A VIRTUAL DESKTOP ?
The Demo!<O>
Seen above is a small timer-based clock that will be stuck on Desktop.
I have applied the "Shadowed Text" effect that I have explained in my previous post.
You may download the Demo : DT_Clock.ahk or View the code : DT_Clock.ahk.txt.
Added: 30-Jun-2006
More efficient way of setting a GUI to be the "Child window of Desktop"
Credit: Enhancement suggested by evl on next post.
Just add these two lines in the beginning when coding a GUI:Gui, +Lastfound DllCall("SetParent", UInt, WinExist() , UInt, WinExist("Program Manager"))
.. and that would suffice !
Copy / Paste / Try Example:Gui, +Lastfound DllCall("SetParent", UInt, WinExist() , UInt, WinExist("Program Manager")) Gui, Show, w400 h300, This GUI is a Child Window of Desktop Return GuiClose: GuiEscape: ExitApp Return






