Jump to content
Sign in to follow this  
DaLiMan

GUI alway on top

Recommended Posts

DaLiMan

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..... :idiot:

Share this post


Link to post
Share on other sites
jpm

$WS_EX_TOPMOST is not a Style but an ExStyle

GuiCreate("DateCrackerDL", 392, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2,-1,$Style)

that's correct the situation :idiot:

Share this post


Link to post
Share on other sites
DaLiMan

$WS_EX_TOPMOST is not a Style but an ExStyle

GuiCreate("DateCrackerDL", 392, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2,-1,$Style)

that's correct the situation :D

<{POST_SNAPBACK}>

Ah, just have to pay more attention.... :idiot:... didn't read the HELP good enough!!!

Thanx.

Share this post


Link to post
Share on other sites
LOULOU

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 )

Share this post


Link to post
Share on other sites
DaLiMan

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 :idiot: }

Thanx for your code LOULOU.

Share this post


Link to post
Share on other sites
Jon

He, this is also a nice way to do it.

Just tried it and as you said, { all is good  :D }

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 :idiot:

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.