Sign in to follow this  
Followers 0
monte

winsetontop

6 posts in this topic

I'm at the end of my long work week...finally! My brain is pretty much fried and I can't think of anyway to do this, so here it is. Is there a way to set a hotkey (run within main gui) that winactivates my main gui or brings it to the front ( guitofront() )?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

WinSetOnTop("My GUI", "", 1)

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Try this:

Hotkeyset("!^s", "_showgui")
Func _showgui()
WinSetOnTop ( $main_gui, "", 1 )
endfunc
Hotkeyset("!^h", "_hidegui")
Func _hidegui()
WinSetOnTop ( $main_gui, "", 0 )
endfunc

Where $main_gui is the variable that represents your gui (the value returned by GUICreate() )

#)

Edited by nfwu

Share this post


Link to post
Share on other sites

thanks valuater, but I don't want to always have the window on top of all windows. I just want to be able to bring the window to the front when needed (without clicking on the taskbar or alt+tab ' ing ). I'd like to implement this from a hotkey if possible. Thanks for your help!

Share this post


Link to post
Share on other sites

thanks nfwu! I didn't want to have the window always on top, so I changed your code to winsetstate. Thanks!

Hotkeyset("#!s", "_showgui")
Func _showgui()
winsetstate ( $main_gui, "", @SW_SHOW )
endfunc
Hotkeyset("#!h", "_hidegui")
Func _hidegui()
Winsetstate ( $main_gui, "", @SW_HIDE )
endfunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0