DaRkf0x Posted November 28, 2010 Share Posted November 28, 2010 (edited) Hello I'm making a GUI with Koda and so far so good but I have one problem, when _I run it, the gui isn't docked where I told it to.. This is the code generated by Koda: expandcollapse popup#include <Misc.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> if _Singleton("Car Town Bot",1) = 0 Then Msgbox(0,"Warning","*** **** *** is already running!") Exit EndIf Opt("GUIOnEventMode", 1) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) Opt("GUIResizeMode", $GUI_DOCKRIGHT+$GUI_DOCKTOP) #Region ### START GUI section ### $Form1 = GUICreate("************t! v 2.5b", 448, 100, 0, 0) $MenuItem1 = GUICtrlCreateMenu("&Main") $MenuItem2 = GUICtrlCreateMenuItem("Startup", $MenuItem1) GUICtrlSetOnEvent(-1, "Startup") $MenuItem3 = GUICtrlCreateMenuItem("Exit F10", $MenuItem1) GUICtrlSetOnEvent(-1, "_Terminate") $MenuItem4 = GUICtrlCreateMenu("&Jobs") $MenuItem6 = GUICtrlCreateMenuItem("***********e F6", $MenuItem4) GUICtrlSetOnEvent(-1, "JobDice") $MenuItem7 = GUICtrlCreateMenuItem("************ F7", $MenuItem4) GUICtrlSetOnEvent(-1, "JobOil") $MenuItem5 = GUICtrlCreateMenu("&*****e F8") GUICtrlSetOnEvent(-1, "**********") $MenuItem8 = GUICtrlCreateMenu("&Pause F9"&@TAB&"F9") GUICtrlSetOnEvent(-1, "_Pause") GUISetOnEvent($GUI_EVENT_CLOSE, "_Terminate") $Progress1 = GUICtrlCreateProgress(112, 24, 329, 33) $Label1 = GUICtrlCreateLabel("Progress:", 112, 0, 48, 17) $Label2 = GUICtrlCreateLabel("Status :", 0, 0, 40, 17) $Label3 = GUICtrlCreateLabel(" Stand By.", 0, 24, 100, 33) GUICtrlSetFont(-1, 12, 800, 0, "Comic Sans MS") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0xFF0000) Dim $Form1_AccelTable[1][2] = [["{F9}", $MenuItem8]] GUISetAccelerators($Form1_AccelTable) GUISetState(@SW_SHOW) #EndRegion ### END GUI section ### What exactly am I doing wrong here? EDIT: it was supposed to be docked in the top right corner of the screen, and it starts in the top left, and about 5pixels off the screen, that is, not even docked anywhere I think. . . EDIT2: Nevermind, ended up setting the form position by hand, even if it isn't fixed. Edited November 28, 2010 by DaRkf0x Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 28, 2010 Moderators Share Posted November 28, 2010 DaRkf0x,What exactly am I doing wrong here?Opt("GUIResizeMode") works on the controls within the GUI, not the GUI itself. As you discovered, you can only locate the GUI by using the location parameters in GUICreate or by a subsequent WinMove. To help you locate the right and bottom corners of the screen when positioning your GUI, remember that AutoIt gives you the @DesktopWidth and @DesktopHeight macros. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
DaRkf0x Posted November 28, 2010 Author Share Posted November 28, 2010 Thanks Yeah I ended up setting the start coordinates by hand, which was no big deal anyway. What I would like to know now is how do I make it fixed in that position, so as one cannot move it anywhere Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 28, 2010 Moderators Share Posted November 28, 2010 DaRkf0x, how do I make it fixed in that position, so as one cannot move it anywhere?Easy! #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Const $SC_MOVE = 0xF010 $hGUI_Move = GUICreate("Movable GUI", 500, 500, 100, 100) GUISetState() $hGUI_Static = GUICreate("Immovable GUI", 500, 500, 200, 200) GUISetState() GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam) If $hWnd = $hGUI_Static Then If BitAND($wParam, 0x0000FFF0) = $SC_MOVE Then Return False EndIf Return $GUI_RUNDEFMSG EndFunc When you know how! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
DaRkf0x Posted November 28, 2010 Author Share Posted November 28, 2010 Oh I shall study that code then Thank you very much 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