penggilas2 Posted November 25, 2009 Share Posted November 25, 2009 anyone know an example script line when execution exe or file.au3 will display in the corner screen not display in the middle of the screen..?? I search with keyword lock GUI in Screen but not find.. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 25, 2009 Moderators Share Posted November 25, 2009 penggilas2, I am afraid I do not fully understand what it is you want to do. Could you please explain a little more clearly or post some code showing the problem. 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...
penggilas2 Posted November 25, 2009 Author Share Posted November 25, 2009 penggilas2, I am afraid I do not fully understand what it is you want to do. Could you please explain a little more clearly or post some code showing the problem. M23 AutoIt : #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> DirCreate(@TempDir & "\sudirosalim") $tempdir = @TempDir & "\sudirosalim" FileInstall("sudirosalim.jpg", $tempdir & "\") SoundPlay(@ScriptDir & "\SoftwarePortable\SudiroSalimFile\Salim-TunhuangKitaro.mp3") Opt('MustDeclareVars', 1) Ghoster() Func Ghoster() Local $hGui, $OptionsBtn, $OptionsDummy, $OptionsContext, $OptionsCommon, $OptionsFile, $msg Local $OptionsExit, $HelpBtn, $HelpDummy, $HelpContext, $HelpRes, $HelpResE, $HelpShut, $HelpShutE, $HelpAbout Local $defaultstatus = " ..oO Hanya Untuk Pribadi dan Untuk Penambahan Oo..", $status, $filemenu, $fileitem, $gui, $background, $font Local $helpmenu, $helpitem, $PWitem, $infoitem, $exititem, $recentfilesmenu, $Deskitem, $ghostitem, $winima Local $separator1, $viewmenu, $viewstatusitem, $viewitem, $okbutton, $cancelbutton Local $statuslabel, $msg, $file Local $Hirenbutton, $hGui, $n Local $hGui, $OptionsBtn, $OptionsDummy, $OptionsContext, $OptionsCommon, $OptionsFile, $msg Local $OptionsExit, $HelpBtn, $HelpDummy, $HelpContext, $HelpWWW, $HelpAbout Local $contextmenu, $button, $buttoncontext, $buttonitem, $msg Local $newsubmenu, $textitem, $fileitem, $saveitem, $infoitem, $BS_FLAT $hgui = GUICreate("WinGhoster Maniax", 270, 270) GUISetBkColor(0xE0FFFF) GUICtrlSetColor(-1, 0xff0000) ; Red $background = GUICtrlCreatePic( $tempdir & "\sudirosalim.jpg", 7, 7, 256, 190) $filemenu = GUICtrlCreateMenu("&Software") $winima = GUICtrlCreateMenuItem("WinIma", $filemenu) $fileitem = GUICtrlCreateMenuItem("UltraISO", $filemenu) $helpmenu = GUICtrlCreateMenu("Info") $PWitem = GUICtrlCreateMenuItem("Partition Wizard", $filemenu) $ghostitem = GUICtrlCreateMenuItem("Ghost32 > GhostFile", $filemenu) $infoitem = GUICtrlCreateMenuItem("Tentang Script", $helpmenu) $exititem = GUICtrlCreateMenuItem("PS Info", $filemenu) $separator1 = GUICtrlCreateMenuItem("", $filemenu, 4) ; create a separator line $viewitem = GUICtrlCreateMenuItem("SudiroSalim", $viewmenu) $HelpBtn = GUICtrlCreateButton("&ShutDown Option", 83, 204, 100, 20, $BS_FLAT) ; Create a dummy control and a contextmenu for the help too $HelpDummy = GUICtrlCreateDummy() $HelpContext = GUICtrlCreateContextMenu($HelpDummy) $HelpRes = GUICtrlCreateMenuItem("Restart", $HelpContext) $HelpResE = GUICtrlCreateMenuItem("EjectCD > Restart", $HelpContext) $HelpShut = GUICtrlCreateMenuItem("ShutDown", $HelpContext) $HelpShutE = GUICtrlCreateMenuItem("EjectCD > ShutDown", $HelpContext) GUICtrlCreateLabel($defaultstatus, 1, 228, 269, 16, BitOR($SS_SIMPLE, $SS_SUNKEN)) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $fileitem Then ShellExecute (@ScriptDir &"\UltraISO\UltraISOPortable.exe") If $msg = $ghostitem Then ShellExecute (@ScriptDir &"\ghost\ghost32.exe") If $msg = $PWitem Then ShellExecute (@ScriptDir &"\partition\partitionwizard.exe") If $msg = $exititem Then MsgBox (0,".oO PS[Portable Software] Oo.", " Kumpulan Software Portable"& @CRLF & " SudiroSalim") If $msg = $infoitem Then MsgBox (0,"..oO Ghoster Maniax Oo.."," ..ooOO Ghoster Menu OOoo.."& @CRLF &" Script Ini Jauh dari Kebenaran " & @CRLF & " Mohon Maaf Jika Ada Kesalahan"& @CRLF &" Karena Yang Bikin Untuk Coba-Coba") If $msg = $GUI_EVENT_CLOSE Then ExitLoop Switch $msg Case $HelpBtn ShowMenu($hGui, $msg, $HelpContext) Case $HelpRes Run ("notepad.exe") Case $HelpResE Run ($tempdir &"\shutdown.exe /eject /u ","",@SW_HIDE) ProgressOn("Proses Reboot", "Silakan Ambil CD nya..!!!", "0 percent") For $i = 10 to 100 step 5 sleep(1000) ProgressSet( $i, $i & " percent") Next ProgressSet(200 , "Done", "Reboot") sleep(1000) ProgressOff() Run ($tempdir &"\shutdown.exe /eject /u ","",@SW_HIDE) Case $HelpShut Run ($tempdir &"\shutdown.exe /shutdown /u ","",@SW_HIDE) Case $HelpShutE Run ($tempdir &"\shutdown.exe /eject /u ","",@SW_HIDE) ProgressOn("Proses Reboot", "Silakan Ambil CD nya..!!!", "0 percent") For $i = 10 to 100 step 5 sleep(1000) ProgressSet( $i, $i & " percent") Next ProgressSet(200 , "Done", "Reboot") sleep(1000) ProgressOff() Run ($tempdir &"\shutdown.exe /shutdown /u ","",@SW_HIDE) EndSwitch WEnd GUIDelete() DirRemove( $tempdir ,1) EndFunc ;==>Example2 ; Show a menu in a given GUI window which belongs to a given GUI ctrl Func ShowMenu($hWnd, $CtrlID, $nContextID) Local $arPos, $x, $y Local $hMenu = GUICtrlGetHandle($nContextID) If FileExists (@SystemDir &"\shutdown.exe") Then $arPos = ControlGetPos($hWnd, "", $CtrlID) $x = $arPos[0] $y = $arPos[1] + $arPos[3] ClientToScreen($hWnd, $x, $y) TrackPopupMenu($hWnd, $hMenu, $x, $y) Else MsgBox (0,"Ghoster Info","Hanya Untuk Ghost Windows"& @CRLF &".oO Only For Ghost Windows Oo." ) EndIf EndFunc ;==>ShowMenu ; Convert the client (GUI) coordinates to screen (desktop) coordinates Func ClientToScreen($hWnd, ByRef $x, ByRef $y) Local $stPoint = DllStructCreate("int;int") DllStructSetData($stPoint, 1, $x) DllStructSetData($stPoint, 2, $y) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint)) $x = DllStructGetData($stPoint, 1) $y = DllStructGetData($stPoint, 2) ; release Struct not really needed as it is a local $stPoint = 0 EndFunc ;==>ClientToScreen ; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd) Func TrackPopupMenu($hWnd, $hMenu, $x, $y) DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0) EndFunc ;==>TrackPopupMenu END AUTOIT... I want when execute that script will run in top left corner screen.. I has search and run all sample script in AutoIt installer but not found sample script run gui in corner screen.. cause i don`t know common script to call and create gui run in corner screen. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 25, 2009 Moderators Share Posted November 25, 2009 penggilas2,If you want a GUI to appear in a specific place, then you need to add the x & y coordinates to the GUICreate command - like this:#include <GUIConstantsEx.au3> #include <StaticConstants.au3> $hGUI_2 = GUICreate("Middle", 200, 200) ; <<<<<<<<<<<<<<<<<<<<< no x or y coordinates here GUICtrlCreateLabel("This is in the middle of the screen", 10, 90, 180, 40, $SS_CENTER) GUISetState() $hGUI_2 = GUICreate("Corner", 200, 200, 0, 0) ; <<<<<<<<<<<<<<< x & y coordinates added here GUICtrlCreateLabel("This is in the Top Left corner of the screen", 10, 90, 180, 40, $SS_CENTER) GUISetState() $hGUI_2 = GUICreate("Corner", 200, 200, @DesktopWidth - 200 , @DesktopHeight - 250) ; <<<<<<<<<<<<<<< add x & y coordinates added here GUICtrlCreateLabel("This is in the Bottom Right corner of the screen", 10, 90, 180, 40, $SS_CENTER) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndIs that what you were looking for? M23P.S. If you use the correct Code tags it makes it much easier to read. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). 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...
penggilas2 Posted November 25, 2009 Author Share Posted November 25, 2009 penggilas2, If you want a GUI to appear in a specific place, then you need to add the x & y coordinates to the GUICreate command - like this: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $hGUI_2 = GUICreate("Middle", 200, 200) ; <<<<<<<<<<<<<<<<<<<<< no x or y coordinates here GUICtrlCreateLabel("This is in the middle of the screen", 10, 90, 180, 40, $SS_CENTER) GUISetState() $hGUI_2 = GUICreate("Corner", 200, 200, 0, 0) ; <<<<<<<<<<<<<<< x & y coordinates added here GUICtrlCreateLabel("This is in the Top Left corner of the screen", 10, 90, 180, 40, $SS_CENTER) GUISetState() $hGUI_2 = GUICreate("Corner", 200, 200, @DesktopWidth - 200 , @DesktopHeight - 250) ; <<<<<<<<<<<<<<< add x & y coordinates added here GUICtrlCreateLabel("This is in the Bottom Right corner of the screen", 10, 90, 180, 40, $SS_CENTER) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Is that what you were looking for? M23 P.S. If you use the correct Code tags it makes it much easier to read. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). U are right.. that's what I was looking for and I want.. Thank M23.. U always give me the solution.. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 25, 2009 Moderators Share Posted November 25, 2009 penggilas2,Glad I could help. One last thing - when you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read.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...
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