Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

GUI always on top


  • Please log in to reply
8 replies to this topic

#1 Craberos

Craberos

    Seeker

  • Active Members
  • 17 posts

Posted 18 May 2010 - 07:16 PM

hello all

thanks for all the help provided

can anyone tell me the code to

1. make a GUI always on top



thanks
craberos

Edited by Craberos, 18 May 2010 - 07:19 PM.








#2 zorphnog

zorphnog

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 448 posts

Posted 18 May 2010 - 07:21 PM

WinSetOnTop. Look at the help file, it's there for a reason.

#3 Craberos

Craberos

    Seeker

  • Active Members
  • 17 posts

Posted 18 May 2010 - 07:45 PM

WinSetOnTop. Look at the help file, it's there for a reason.


that did not work

i need to make the gui created by autoit to be always on top
Plain Text         
#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example()     Local $button_1,$button_2, $button_3, $button_4     Local $Halt, $msg     Opt("GUICoordMode", 1)     GUICreate("T", 140, 260)     $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40)     $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40)     $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40)     $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40)                 GUISetState()         While 1         $msg = GUIGetMsg()         Select             Case $msg = $GUI_EVENT_CLOSE                 Exit             Case $msg = $GUI_EVENT_MINIMIZE             Case $msg = $GUI_EVENT_MAXIMIZE                             Case $msg = $button_1                 WinActivate ("Earth")             Case $msg = $button_2                 WinActivate ("Water")             Case $msg = $button_3                 WinActivate ("Fire")             Case $msg = $button_4                 WinActivate ("Air")                                         Case $Halt = $msg         EndSelect     WEnd EndFunc  

Edited by Craberos, 18 May 2010 - 07:46 PM.


#4 simon387

simon387

    Seeker

  • Active Members
  • 22 posts

Posted 18 May 2010 - 07:54 PM

that did not work

i need to make the gui created by autoit to be always on top

Plain Text         
#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example()     Local $button_1,$button_2, $button_3, $button_4     Local $Halt, $msg     Opt("GUICoordMode", 1)     GUICreate("T", 140, 260)     $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40)     $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40)     $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40)     $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40)                 GUISetState()         While 1         $msg = GUIGetMsg()         Select             Case $msg = $GUI_EVENT_CLOSE                 Exit             Case $msg = $GUI_EVENT_MINIMIZE             Case $msg = $GUI_EVENT_MAXIMIZE                             Case $msg = $button_1                 WinActivate ("Earth")             Case $msg = $button_2                 WinActivate ("Water")             Case $msg = $button_3                 WinActivate ("Fire")             Case $msg = $button_4                 WinActivate ("Air")                                         Case $Halt = $msg         EndSelect     WEnd EndFunc  

AutoIt         
#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example()     Local $button_1,$button_2, $button_3, $button_4     Local $Halt, $msg     Opt("GUICoordMode", 1)     GUICreate("T", 140, 260)     $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40)     $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40)     $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40)     $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40)     WinSetOnTop("T", "", 1)     GUISetState()     While 1         $msg = GUIGetMsg()         Select             Case $msg = $GUI_EVENT_CLOSE                 Exit             Case $msg = $GUI_EVENT_MINIMIZE             Case $msg = $GUI_EVENT_MAXIMIZE             Case $msg = $button_1                 WinActivate ("Earth")             Case $msg = $button_2                 WinActivate ("Water")             Case $msg = $button_3                 WinActivate ("Fire")             Case $msg = $button_4                 WinActivate ("Air")             Case $Halt = $msg         EndSelect     WEnd EndFunc


#5 Craberos

Craberos

    Seeker

  • Active Members
  • 17 posts

Posted 18 May 2010 - 08:08 PM

AutoIt         
#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example()     Local $button_1,$button_2, $button_3, $button_4     Local $Halt, $msg     Opt("GUICoordMode", 1)     GUICreate("T", 140, 260)     $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40)     $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40)     $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40)     $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40)     WinSetOnTop("T", "", 1)     GUISetState()     While 1         $msg = GUIGetMsg()         Select             Case $msg = $GUI_EVENT_CLOSE                 Exit             Case $msg = $GUI_EVENT_MINIMIZE             Case $msg = $GUI_EVENT_MAXIMIZE             Case $msg = $button_1                 WinActivate ("Earth")             Case $msg = $button_2                 WinActivate ("Water")             Case $msg = $button_3                 WinActivate ("Fire")             Case $msg = $button_4                 WinActivate ("Air")             Case $Halt = $msg         EndSelect     WEnd EndFunc


i copied your code and tried it is not working



#6 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,869 posts

Posted 18 May 2010 - 08:35 PM

Use the extended style $WS_EX_TOPMOST in GUICreate.

Edited by somdcomputerguy, 18 May 2010 - 08:36 PM.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.


#7 Craberos

Craberos

    Seeker

  • Active Members
  • 17 posts

Posted 18 May 2010 - 08:47 PM

Use the extended style $WS_EX_TOPMOST in GUICreate.


i had to include "#include <WindowsConstants.au3>" and it worked but previously it was centered now it is on the left corner of the desktop any solutions




Plain Text         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Example() Func Example()     Local $button_1,$button_2, $button_3, $button_4     Local $Halt, $msg     Opt("GUICoordMode", 1)     GUICreate("T", 140, 260,$WS_EX_TOPMOST)                 $button_1 = GUICtrlCreateButton("Earth", 20, 20, 100, 40)     $button_2 = GUICtrlCreateButton("Water", 20, 80, 100, 40)     $button_3 = GUICtrlCreateButton("Fire", 20, 140, 100, 40)     $button_4 = GUICtrlCreateButton("Air", 20, 200, 100, 40)         GUISetState()     While 1         $msg = GUIGetMsg()         Select             Case $msg = $GUI_EVENT_CLOSE                 Exit             Case $msg = $GUI_EVENT_MINIMIZE             Case $msg = $GUI_EVENT_MAXIMIZE             Case $msg = $button_1                 WinActivate ("Earth")             Case $msg = $button_2                 WinActivate ("Water")             Case $msg = $button_3                 WinActivate ("Fire")             Case $msg = $button_4                 WinActivate ("Air")             Case $Halt = $msg         EndSelect     WEnd EndFunc  

Edited by Craberos, 18 May 2010 - 08:48 PM.


#8 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,869 posts

Posted 19 May 2010 - 01:13 AM

Use GUICreate("T", 140, 260, -1, -1, Default, $WS_EX_TOPMOST).

Edited by somdcomputerguy, 19 May 2010 - 01:15 AM.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.


#9 Craberos

Craberos

    Seeker

  • Active Members
  • 17 posts

Posted 19 May 2010 - 06:55 AM

Use GUICreate("T", 140, 260, -1, -1, Default, $WS_EX_TOPMOST).



thanks a ton somdcomputerguy it worked like a charm :idea: thanks you






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users