Jump to content

Gui position ?


Go to solution Solved by JLogan3o13,

Recommended Posts

  • Moderators
  • Solution

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()

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...