DaLiMan Posted December 27, 2004 Share Posted December 27, 2004 Hi, I wan't to create a GUI which is alway's on top after selecting a program to run. I thought it was $WS_EX_TOPMOST or $WS_EX_APPWINDOW which I had to use. I tried several combinations without luck so far. Here's what I have: #include <GuiConstants.au3> $message = "Select your program:" Global $style=$WS_EX_APPWINDOW $var = FileOpenDialog($message, "C:\Progra~1\", "Executables (*.exe)", 5 ) GuiCreate("DateCrackerDL", 392, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2,$Style) $button_1 = GuiCtrlCreateButton("Stop", 20, 275, 90, 20) $Begin = TimerInit() Run($var) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button_1 $Dif = TimerDiff($Begin)+1000 ExitLoop EndSelect WEnd MsgBox(0,"Time Difference",$Dif) Please help..... Link to comment Share on other sites More sharing options...
jpm Posted December 27, 2004 Share Posted December 27, 2004 $WS_EX_TOPMOST is not a Style but an ExStyleGuiCreate("DateCrackerDL", 392, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2,-1,$Style) that's correct the situation Link to comment Share on other sites More sharing options...
DaLiMan Posted December 27, 2004 Author Share Posted December 27, 2004 $WS_EX_TOPMOST is not a Style but an ExStyleGuiCreate("DateCrackerDL", 392, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2,-1,$Style)that's correct the situation <{POST_SNAPBACK}>Ah, just have to pay more attention.... ... didn't read the HELP good enough!!!Thanx. Link to comment Share on other sites More sharing options...
LOULOU Posted December 27, 2004 Share Posted December 27, 2004 For having my gui always on top After creating my Gui GuiCreate("Association des numéros de compte", 559, 358,(@DesktopWidth-559)/2, (@DesktopHeight-358)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) and displaying it GuiSetState()I give this synthax and all is good WinSetOnTop ( "Association des numéros de compte", "", 1 )and when i want that my gui stay at background WinSetOnTop ( "Association des numéros de compte", "", 0 ) Link to comment Share on other sites More sharing options...
DaLiMan Posted December 28, 2004 Author Share Posted December 28, 2004 For having my gui always on top After creating my Gui GuiSetState()I give this synthax and all is good WinSetOnTop ( "Association des numéros de compte", "", 1 )<{POST_SNAPBACK}>He, this is also a nice way to do it.Just tried it and as you said, { all is good }Thanx for your code LOULOU. Link to comment Share on other sites More sharing options...
Administrators Jon Posted December 28, 2004 Administrators Share Posted December 28, 2004 He, this is also a nice way to do it.Just tried it and as you said, { all is good }Thanx for your code LOULOU.If you really want to be flashy then:$handle = GuiCreate(......) WinSetOnTop($handle, "", 1)But using the proper $WS_EX_TOPMOST as the ExStyle in the GuiCreate function is the "proper" way to do it Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ 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