armoros Posted April 17, 2012 Posted April 17, 2012 Once again and not last i need help.. This is a script of an embedded cmd in my gui, i want to know if it is possible to reopen the embedded cmd after it is closed. with out to run the gui app again. Or if it is possible to forbid the closing of cmd from inside the gui ? Thanks once again.. #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) Global $Init_Dir = "C:\" $Main_GUI = GUICreate("Embedded CMD", 700, 500, 10, 10) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUIRegisterMsg(0xF, "WM_PAINT") $iCmd_PID = Run(@ComSpec & " /k CD " & $Init_Dir, "", @SW_HIDE) ProcessWait($iCmd_PID) $Embed_hWnd = _GetHWndByPID($iCmd_PID) WinMove($Embed_hWnd, "", -2, -23, 549, 342) WinSetState($Embed_hWnd, "", @SW_SHOWMINIMIZED) GUISetState(@SW_SHOW, $Main_GUI) DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $Embed_hWnd, "hwnd", $Main_GUI) While 1 Sleep(100) If WinActive($Main_GUI) Then WinActivate($Embed_hWnd) WEnd Func Quit() ProcessClose($iCmd_PID) Exit EndFunc Func _GetHWndByPID($iPID) Local $aWinList = WinList() For $i = 1 To UBound($aWinList)-1 If WinGetProcess($aWinList[$i][1]) = $iPID Then Return $aWinList[$i][1] Next Return 0 EndFunc Func WM_PAINT($hWnd, $Msg, $wParam, $lParam) DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0) EndFunc [font="verdana, geneva, sans-serif"] [/font]
Xenobiologist Posted April 17, 2012 Posted April 17, 2012 Should be possible to restart the cmd.exe. But why do you need the cmd at all? Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
armoros Posted April 17, 2012 Author Posted April 17, 2012 Should be possible to restart the cmd.exe. But why do you need the cmd at all?I now some other ways (from other users) how to output commands in guibut i like to press ALT+ENTER for zoom in cmd ...if that makes any sense...Thank you Xeno.. [font="verdana, geneva, sans-serif"] [/font]
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