Jump to content

winsetontop


monte
 Share

Recommended Posts

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() )?

Link to comment
Share on other sites

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
Link to comment
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!

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...