x0xar33wx0x Posted November 9, 2007 Share Posted November 9, 2007 How can I make it so it will fit my gui to the users screen resolution when they launch my program? Link to comment Share on other sites More sharing options...
toothyXdip Posted November 9, 2007 Share Posted November 9, 2007 (edited) 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 November 9, 2007 by toothyXdip ---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝'''║'''╝╝║'''║......║'''║'''║'''║'''''''''║'''''''''║'''║---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''╝''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝ Link to comment Share on other sites More sharing options...
x0xar33wx0x Posted November 10, 2007 Author Share Posted November 10, 2007 that doesn't work Link to comment Share on other sites More sharing options...
toothyXdip Posted November 10, 2007 Share Posted November 10, 2007 (edited) works for me why what errors are you getting/what is going wrong? Edited November 10, 2007 by toothyXdip ---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝'''║'''╝╝║'''║......║'''║'''║'''║'''''''''║'''''''''║'''║---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''╝''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝ Link to comment Share on other sites More sharing options...
therks Posted November 12, 2007 Share Posted November 12, 2007 that doesn't workSure it does, you just have to do it different (we can be vague too). My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Achilles Posted November 13, 2007 Share Posted November 13, 2007 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 More sharing options...
Vindicator209 Posted November 13, 2007 Share Posted November 13, 2007 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 More sharing options...
Achilles Posted November 13, 2007 Share Posted November 13, 2007 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.CheersHowever, 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 More sharing options...
BrettF Posted November 13, 2007 Share Posted November 13, 2007 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 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
NomadRJ Posted November 13, 2007 Share Posted November 13, 2007 Nice tip Bert! I was working fine with DesktopWidth & @DesktopHeight, but in this case you don't know the height of the taskbar set by user. Your function does a better job. Thanks! [ ]s Link to comment Share on other sites More sharing options...
Danny35d Posted November 13, 2007 Share Posted November 13, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now