penggilas2 Posted March 26, 2010 Posted March 26, 2010 It`s Possible to Run And Minimize Program in a Gui..?? Not in Taskbar WIndosws..? Example In this Script.. expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $X = @DesktopWidth $Y = @DesktopHeight $hP = GUICreate("Parent", $X, $Y, 0, 0, BitOR($WS_POPUP, $WS_EX_TOPMOST),-1, WinGetHandle(AutoItWinGetTitle())) GUISetBkColor(0) GUISetState() $ch = GUICreate("Child", $X, $Y -40, 0, $Y -40, BitOR($WS_MINIMIZEBOX, $WS_CHILD,$WS_BORDER),-1,$hP) GUISetBkColor(0xA6CAF0) $OptionsBtn = GUICtrlCreateButton("Start",0, 0, 40, 40) $OptionsDummy = GUICtrlCreateDummy() $OptionsContext = GUICtrlCreateContextMenu($OptionsDummy) $OptionsCommon = GUICtrlCreateMenuItem("Calculator", $OptionsContext) $OptionsFile = GUICtrlCreateMenuItem("Notepad", $OptionsContext) GUICtrlCreateMenuItem("", $OptionsContext) $OptionsExit = GUICtrlCreateMenuItem("Exit", $OptionsContext) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $OptionsExit Exit Case $OptionsCommon Run("calc.exe") Case $OptionsFile Run("notepad.exe") Case $OptionsBtn ShowMenu($hP, $nmsg, $OptionsContext) EndSwitch WEnd ; 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) $arPos = ControlGetPos($hWnd, "", $CtrlID) $x = $arPos[0] $y = $arPos[1] + $arPos[0] ClientToScreen($hWnd, $x, $y) TrackPopupMenu($hWnd, $hMenu, $x, $y) 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 How to Minimize Notepad And Calc. In Child Gui..? Thank`s..
BrettF Posted March 26, 2010 Posted March 26, 2010 Ooo. Desktop shell replacement. Take a look at the vast amount of entries we had for a little bit of competitive fun a while back Cheers, Brett 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!
penggilas2 Posted March 27, 2010 Author Posted March 27, 2010 Ooo. Desktop shell replacement. Take a look at the vast amount of entries we had for a little bit of competitive fun a while back Cheers,Brett
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