Jump to content

How do I fit my gui to the users screen


x0xar33wx0x
 Share

Recommended Posts

you mean

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", @DesktopWidth, @DesktopHeight-60, -1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
Edited by toothyXdip
---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
Link to comment
Share on other sites

works for me

why what errors are you getting/what is going wrong?

Edited by toothyXdip
---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
Link to comment
Share on other sites

The key line of code in toothyXdip was the GuiCreate. The @DesktkopHeight and @DesktopWidth return the height and width of desktop screen. So if you do GuiCreate('Testing', @DesktopHeight, @DesktopWidth), it will create a GUI that is as big as your screen.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Plus the -60 so it doesn't cover the taskbar.

You'll have to tell us what isin't working, or what errors your getting, "it doesnt work" doesn't help.

Cheers

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Plus the -60 so it doesn't cover the taskbar.

You'll have to tell us what isin't working, or what errors your getting, "it doesnt work" doesn't help.

Cheers

However, just subtracting 60 from the height doesn't always work due to varying sizes/positions of the taskbar. You can use WinGetPos to do it. I don't have time to conjure an example but somebody else might.
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

This works well:

;===============================================================================
;
; Function Name:    _GetWorkingArea()
; Description:    Returns the coordinates of desktop working area rectangle
; Parameter(s):  None
; Return Value(s):  On Success - Array containing coordinates:
;                       $a[0] = left
;                       $a[1] = top
;                       $a[2] = right
;                       $a[3] = bottom
;                  On Failure - 0
;
;===============================================================================
Func _GetWorkingArea()
    #cs
        BOOL WINAPI SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
        uiAction SPI_GETWORKAREA = 48
    #ce
    Local $dRECT = DllStructCreate("long; long; long; long")
    Local $spiRet = DllCall("User32.dll", "int", "SystemParametersInfo", _
            "uint", 48, "uint", 0, "ptr", DllStructGetPtr($dRECT), "uint", 0)
    If @error Then Return 0
    If $spiRet[0] = 0 Then Return 0
    Local $aRet[4] = [DllStructGetData($dRECT, 1), DllStructGetData($dRECT, 2), DllStructGetData($dRECT, 3), DllStructGetData($dRECT, 4) ]
    Return $aRet
EndFunc  ;==>_GetWorkingArea
Link to comment
Share on other sites

Tri it:

#include <GUIConstants.au3>

Opt("WinTitleMatchMode", 4)

$Pos = WinGetPos("classname=Shell_TrayWnd")
If $Pos[2] <> @DesktopWidth Then $Pos[2] = @DesktopWidth - $Pos[2]
If $Pos[3] <> @DesktopHeight Then 
    $Pos[3] = @DesktopHeight - ($Pos[3] + 32)
Else
    $Pos[3] -= 32
EndIf

$Form1 = GUICreate("AForm1", $Pos[2], $Pos[3], -1, -1)
GUISetBkColor (0xE0FFFF)
GUISetState(@SW_SHOW)

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

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
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...