HalliHallistra Posted August 3, 2013 Share Posted August 3, 2013 Hello Guys ... I'm trying to make a simple script but already failing at it I want that the Window is Always on top when i press the Button for the first time ... If it's pressed again window shouldn't be always on top anymore I hope anyone is able to help me with that problem. there's what i got yet : #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 88, 32, 249, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Winontop="0" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $Winontop="0" Then WinSetOnTop($Form1,"",1) $Winontop="1" Else ???? $Winontop="0" EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
Edano Posted August 3, 2013 Share Posted August 3, 2013 ;http://www.autoitscript.com/forum/topic/153282-winsetontop-undo/ ;Post #1 ;D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\SLICER\Avatar\default_large.png ;by HalliHallistra ;Script grabbed by SLICER by Edano here: http://www.autoitscript.com/forum/topic/152402-slicer-autoit-forum-script-grabber/?p=1093575 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 88, 32, 249, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Winontop="0" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $Winontop="0" Then WinSetOnTop($Form1,"",1) $Winontop="1" Else WinSetOnTop($Form1,"",0) $Winontop="0" EndIf EndSwitch WEnd [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] Link to comment Share on other sites More sharing options...
HalliHallistra Posted August 3, 2013 Author Share Posted August 3, 2013 (edited) ;http://www.autoitscript.com/forum/topic/153282-winsetontop-undo/ ;Post #1 ;D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\SLICER\Avatar\default_large.png ;by HalliHallistra ;Script grabbed by SLICER by Edano here: http://www.autoitscript.com/forum/topic/152402-slicer-autoit-forum-script-grabber/?p=1093575 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 88, 32, 249, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Winontop="0" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $Winontop="0" Then WinSetOnTop($Form1,"",1) $Winontop="1" Else WinSetOnTop($Form1,"",0) $Winontop="0" EndIf EndSwitch WEnd Didn't think it was that easy, thank you very much ! Can't Press the Like This! Button ... but remember i like it XD Edited August 3, 2013 by HalliHallistra Link to comment Share on other sites More sharing options...
Edano Posted August 3, 2013 Share Posted August 3, 2013 very easy yw [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now