Jump to content
Sign in to follow this  
Alexxander

Gui position ?

Recommended Posts

Something like this, based on the size of your gui?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


GUICreate("Test", 300, 300, @DesktopWidth - 300, @DesktopHeight - 300)
GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

GUIDelete()

Share this post


Link to post
Share on other sites

 

Something like this, based on the size of your gui?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


GUICreate("Test", 300, 300, @DesktopWidth - 300, @DesktopHeight - 300)
GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

GUIDelete()

 

perfect thanks

Share this post


Link to post
Share on other sites

I use something like this in several of my scripts.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 261, 164)
;Gets the Control ID of the taskbar.
$aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "")
;Gets the position and size of $MainForm
$aWin = WinGetPos($Form1)
;moves the form above the clock on the task bar.
WinMove($Form1, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

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  

×
×
  • Create New...