Guest Posted March 24, 2012 Posted March 24, 2012 Hey GUIs... I mean guys take a look at this script I threw together is 3 minutes Its CMD you type something in and it executes it and returns the results! #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Hotkeyset("{Enter}", "executerun") GUICreate("CMD", 600, 400) GUISetState(@SW_SHOW) $edit = GUIctrlcreateedit("", 0, 0, 600, 400) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd func executerun() $runloop = run(GUIctrlread($edit)) GUIctrlsetdata($edit, $runloop) endfunc Thought you would be interested.
JScript Posted March 24, 2012 Posted March 24, 2012 (edited) Hello! Nice idea but not work as expected! Try this:expandcollapse popup#NoTrayIcon #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Local $vDos, $sline = "" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("CMD", 446, 466, 283, 173) $Edit1 = GUICtrlCreateEdit("", 8, 8, 433, 385) GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0x000000) $Group1 = GUICtrlCreateGroup("Command", 8, 400, 433, 57) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("", 16, 424, 337, 21) GUICtrlSetState(-1, $GUI_FOCUS) $Button1 = GUICtrlCreateButton("Go Send", 360, 421, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;----> Create dummy keys for accelerators $hENTER = GUICtrlCreateDummy() Dim $AccelKeys[1][2] = [["{ENTER}", $hENTER]] ; Set accelerators GUISetAccelerators($AccelKeys) ;<---- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1, $hENTER $vDos = Run(@ComSpec & " /c " & GUICtrlRead($Input1), @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $sline &= StdoutRead($vDos) If @error Then ExitLoop WEnd GUICtrlSetData($Edit1, $sline & @CRLF) GUICtrlSetData($Input1, "") ;----> Reset $sline = "" ;<---- EndSwitch WEnd Regards, João Carlos. Edited March 24, 2012 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Skitty Posted March 25, 2012 Posted March 25, 2012 (edited) I'm pretty interested in this, it would be good to create a UDF that would allow for embedding an interactive command processing window into a gui etc, don't you think so? I've been playing with this but am failing miserably and need to handle what happens when I hold down a key for too long, this is the best I've got for the moment, if anyone wants to help I'd appreciate it. expandcollapse popup#NoTrayIcon #include <Constants.au3> Global Const $hUSER32 = DllOpen("User32.dll") Global Const $WS_RESIZABLE = 0x00070000 Global $nMsg Global $PID Global Const $aCtrlComnds = _Controls() Global $temporariis Global $Statum Global $reversus Global $datum Global $mandatum Global $claudicatis_operatio = 0 Global $HHook Global $hKB_Hook HotKeySet("{BACKSPACE}", "CatchIt") _SetHooks(1) $PID = Run(@ComSpec, @WorkingDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $reversus &= StdoutRead($PID) If @error Then ExitLoop WEnd $temporariis = $reversus $datum = StringLen($reversus) OnAutoItExitRegister("_Exit") Opt("GUIEventOptions", 1) #region ### START Koda GUI section ### Form= $Console = GUICreate("CMD", 668, 331, 283, 173, $WS_RESIZABLE) GUIRegisterMsg(0x0024, "WM_GETMINMAXINFO") ;GUIRegisterMsg(0x0006,"Statum") GUISetIcon(@SystemDir & "cmd.exe") $hCMD = GUICtrlCreateEdit("", 0, 0, 666, 327) GUICtrlSetFont(-1, 9, 600, 0, "lucida console") GUICtrlSetColor(-1, 0xC0C0C0) GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) GUICtrlSetData($hCMD, $reversus) #endregion ### END Koda GUI section ### While 1 $Statum = WinGetState($Console) $nMsg = GUIGetMsg($Console) Switch $nMsg Case -3 Exit EndSwitch Switch $Statum Case 15 HotKeySet("{BACKSPACE}", "CatchIt") $claudicatis_operatio = 0 Case 7 HotKeySet("{BACKSPACE}") $claudicatis_operatio = 1 EndSwitch WEnd Func Exsequor($mandatum) $PID = Run(@ComSpec & " /c " & $mandatum, @WorkingDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While ProcessExists($PID) $temporariis &= StdoutRead($PID) If @error Then ExitLoop WEnd $claudicatis_operatio = 0 Return $temporariis EndFunc ;==>Exsequor Func _SetHooks($Type = False) Switch $Type Case True $hKB_Hook = DllCallbackRegister("_KeyProcess", "long", "int;wparam;lparam") If Not $hKB_Hook Then Return SetError(1, 0, False) Local $aResult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", "ptr", 0) If @error Then Return SetError(2, @error, False) $aResult = DllCall($hUSER32, "handle", "SetWindowsHookEx", _ "int", 13, _ ; WH_KEYBOARD_LL "ptr", DllCallbackGetPtr($hKB_Hook), _ "handle", $aResult[0], _ "dword", 0 _ ) If @error Then Return SetError(3, @error, False) $HHook = $aResult[0] EndSwitch Return SetError(0, 0, True) EndFunc ;==>_SetHooks Func _KeyProcess($NCode, $WParam, $LParam) Local $aResult If $NCode < 0 Then $aResult = DllCall($hUSER32, "lresult", "CallNextHookEx", "handle", $HHook, "int", $NCode, "wparam", $WParam, "lparam", $LParam) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndIf Local $kcStruc = DllStructCreate("dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo", $LParam) If Not $claudicatis_operatio Then Switch $WParam Case 256 DllCall($hUSER32, "long", "GetKeyState", "long", 0) If Not $claudicatis_operatio Then If DllStructGetData($kcStruc, "vkCode") = 13 Then $claudicatis_operatio = 1 $temporariis = Exsequor($mandatum) $mandatum = "" $reversus &= @CRLF & $temporariis $temporariis = $reversus $datum = StringLen($reversus) GUICtrlSetData($hCMD, $reversus) ;_GUICtrlEdit_AppendText($Console, $data) EndIf EndIf Case Else Local $scanCode = DllStructGetData($kcStruc, "scanCode") Local $vkCode = DllStructGetData($kcStruc, "vkCode") If $aCtrlComnds[$vkCode][1] Then;don't process control characters Local $KeyProcess = DllStructCreate("byte[256];Char") DllCall($hUSER32, "int", "GetKeyboardState", "ptr", DllStructGetPtr($KeyProcess)) If @error Then Return SetError(@error, 0, 0) DllCall($hUSER32, "int", "ToAsciiEx", _ "uint", $vkCode, _ "uint", $scanCode, _ "ptr", DllStructGetPtr($KeyProcess, 1), _ "ptr", DllStructGetPtr($KeyProcess, 2), _ "uint", 0, _ "hwnd", "" _ ) If Not @error Then $mandatum &= DllStructGetData($KeyProcess, 2) $reversus &= DllStructGetData($KeyProcess, 2) $datum = StringLen($reversus) GUICtrlSetData($hCMD, $reversus) ConsoleWrite("$mandatum>" & $mandatum & @CR) EndIf EndSwitch EndIf $aResult = DllCall($hUSER32, "lresult", "CallNextHookEx", "handle", $HHook, "int", $NCode, "wparam", $WParam, "lparam", $LParam) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndFunc ;==>_KeyProcess Func CatchIt() If (StringLen(StringTrimRight($temporariis, 1)) <= $datum - 2) Then $reversus = StringTrimRight($reversus, 1) $datum = StringLen($reversus) $mandatum = StringTrimRight($mandatum, 1) GUICtrlSetData($hCMD, $reversus) EndIf Return EndFunc ;==>CatchIt Func WM_GETMINMAXINFO($hwnd, $Msg, $WParam, $LParam) Local $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $LParam) DllStructSetData($tagMaxinfo, 7, 116) ; min X DllStructSetData($tagMaxinfo, 8, 59) ; min Y DllStructSetData($tagMaxinfo, 9, 668); max X DllStructSetData($tagMaxinfo, 10, @DesktopHeight) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFO Func _Exit() _SetHooks() DllClose($hUSER32) OnAutoItExitUnRegister("_Exit") Exit EndFunc ;==>_Exit Func _Controls() Local $aVK[223][2] = _; Key Down DEC HEX [ _ ["", True], _ ; 0 00000000 ["", True], _ ; 1 00000001 ["", True], _ ; 2 00000002 ["", True], _ ; 3 00000003 ["", True], _ ; 4 00000004 ["", True], _ ; 5 00000005 ["", True], _ ; 6 00000006 ["", True], _ ; 7 00000007 ["[BACK SPACE]", False], _ ; 8 00000008 ["[TAB]", False], _ ; 9 00000009 ["", True], _ ; 10 0000000A ["", True], _ ; 11 0000000B ["[CLEAR]", False], _ ; 12 0000000C ["[ENTER]", False], _ ; 13 0000000D ["", True], _ ; 14 0000000E ["", True], _ ; 15 0000000F ["[SHIFT]", False], _ ; 16 00000010 ["[CTRL]", False], _ ; 17 00000011 ["[ALT]", False], _ ; 18 00000012 ["[PAUSE]", False], _ ; 19 00000013 ["[CAPS LOCK]", False], _ ; 20 00000014 ["", True], _ ; 21 00000015 ["", True], _ ; 22 00000016 ["", True], _ ; 23 00000017 ["", True], _ ; 24 00000018 ["", True], _ ; 25 00000019 ["", True], _ ; 26 0000001A ["[ESC]", False], _ ; 27 0000001B ["", True], _ ; 28 0000001C ["", True], _ ; 29 0000001D ["", True], _ ; 30 0000001E ["", True], _ ; 31 0000001F ["[SPACE]", True], _ ; 32 00000020 ["[PAGE UP]", False], _ ; 33 00000021 ['[PAGE DOWN]', False], _ ; 34 00000022 ["[END]", False], _ ; 35 00000023 ["[HOME]", False], _ ; 36 00000024 ["[LEFT ARROW]", False], _ ; 37 00000025 ["[UP ARROW]", False], _ ; 38 00000026 ["[RIGHT ARROW]", False], _ ; 39 00000027 ["[DOWN ARROW]", False], _ ; 40 00000028 ["", True], _ ; 41 00000029 ["", True], _ ; 42 0000002A ["", True], _ ; 43 0000002B ["[PRINT-SCREEN]", False], _ ; 44 0000002C ["[INSERT]", False], _ ; 45 0000002D ["[DELETE]", False], _ ; 46 0000002E ["", True], _ ; 47 0000002F ["", True], _ ; 48 00000030 ["", True], _ ; 49 00000031 ["", True], _ ; 50 00000032 ["", True], _ ; 51 00000033 ["", True], _ ; 52 00000034 ["", True], _ ; 53 00000035 ["", True], _ ; 54 00000036 ["", True], _ ; 55 00000037 ["", True], _ ; 56 00000038 ["", True], _ ; 57 00000039 ["", True], _ ; 58 0000003A ["", True], _ ; 59 0000003B ["", True], _ ; 60 0000003C ["", True], _ ; 61 0000003D ["", True], _ ; 62 0000003E ["", True], _ ; 63 0000003F ["", True], _ ; 64 00000040 ["", True], _ ; 65 00000041 ["", True], _ ; 66 00000042 ["", True], _ ; 67 00000043 ["", True], _ ; 68 00000044 ["", True], _ ; 69 00000045 ["", True], _ ; 70 00000046 ["", True], _ ; 71 00000047 ["", True], _ ; 72 00000048 ["", True], _ ; 73 00000049 ["", True], _ ; 74 0000004A ["", True], _ ; 75 0000004B ["", True], _ ; 76 0000004C ["", True], _ ; 77 0000004D ["", True], _ ; 78 0000004E ["", True], _ ; 79 0000004F ["", True], _ ; 80 00000050 ["", True], _ ; 81 00000051 ["", True], _ ; 82 00000052 ["", True], _ ; 83 00000053 ["", True], _ ; 84 00000054 ["", True], _ ; 85 00000055 ["", True], _ ; 86 00000056 ["", True], _ ; 87 00000057 ["", True], _ ; 88 00000058 ["", True], _ ; 89 00000059 ["", True], _ ; 90 0000005A ["[L-WINDOWS KEY]", False], _ ; 91 0000005B ["[R-WINDOWS KEY]", False], _ ; 92 0000005C ["[APP-KEY]", False], _ ; 93 0000005D ["", True], _ ; 94 0000005E ["", True], _ ; 95 0000005F ["", True], _ ; 96 00000060 ["", True], _ ; 97 00000061 ["", True], _ ; 98 00000062 ["", True], _ ; 99 00000063 ["", True], _ ; 100 00000064 ["", True], _ ; 101 00000065 ["", True], _ ; 102 00000066 ["", True], _ ; 103 00000067 ["", True], _ ; 104 00000068 ["", True], _ ; 105 00000069 ["", True], _ ; 106 0000006A ["", True], _ ; 107 0000006B ["", True], _ ; 108 0000006C ["", True], _ ; 109 0000006D ["", True], _ ; 110 0000006E ["", True], _ ; 111 0000006F ["[F1]", False], _ ; 112 00000070 ["[F2]", False], _ ; 113 00000071 ["[F3]", False], _ ; 114 00000072 ["[F4]", False], _ ; 115 00000073 ["[F5]", False], _ ; 116 00000074 ["[F6]", False], _ ; 117 00000075 ["[F7]", False], _ ; 118 00000076 ["[F8]", False], _ ; 119 00000077 ["[F9]", False], _ ; 120 00000078 ["[F10]", False], _ ; 121 00000079 ["[F11]", False], _ ; 122 0000007A ["[F12]", False], _ ; 123 0000007B ["", True], _ ; 124 0000007C ["", True], _ ; 125 0000007D ["", True], _ ; 126 0000007E ["", True], _ ; 127 0000007F ["", True], _ ; 128 00000080 ["", True], _ ; 129 00000081 ["", True], _ ; 130 00000082 ["", True], _ ; 131 00000083 ["", True], _ ; 132 00000084 ["", True], _ ; 133 00000085 ["", True], _ ; 134 00000086 ["", True], _ ; 135 00000087 ["", True], _ ; 136 00000088 ["", True], _ ; 137 00000089 ["", True], _ ; 138 0000008A ["", True], _ ; 139 0000008B ["", True], _ ; 140 0000008C ["", True], _ ; 141 0000008D ["", True], _ ; 142 0000008E ["", True], _ ; 143 0000008F ["[NUM-LOCK]", False], _ ; 144 00000090 ["[SCROLL LOCK]", False], _ ; 145 00000091 ["", True], _ ; 146 00000092 ["", True], _ ; 147 00000093 ["", True], _ ; 148 00000094 ["", True], _ ; 149 00000095 ["", True], _ ; 150 00000096 ["", True], _ ; 151 00000097 ["", True], _ ; 152 00000098 ["", True], _ ; 153 00000099 ["", True], _ ; 154 0000009A ["", True], _ ; 155 0000009B ["", True], _ ; 156 0000009C ["", True], _ ; 157 0000009D ["", True], _ ; 158 0000009E ["", True], _ ; 159 0000009F ["[L-SHIFT]", False], _ ; 160 000000A0 ["[R-SHIFT]", False], _ ; 161 000000A1 ["[L-CTRL]", False], _ ; 162 000000A2 ["[R-CTRL]", False], _ ; 163 000000A3 ["[L-ALT]", False], _ ; 164 000000A4 ["[R-ALT]", False], _ ; 165 000000A5 ["", True], _ ; 166 000000A6 ["", True], _ ; 167 000000A7 ["", True], _ ; 168 000000A8 ["", True], _ ; 169 000000A9 ["", True], _ ; 170 000000AA ["", True], _ ; 171 000000AB ["", True], _ ; 172 000000AC ["", True], _ ; 173 000000AD ["", True], _ ; 174 000000AE ["", True], _ ; 175 000000AF ["", True], _ ; 176 000000B0 ["", True], _ ; 177 000000B1 ["", True], _ ; 178 000000B2 ["", True], _ ; 179 000000B3 ["", True], _ ; 180 000000B4 ["", True], _ ; 181 000000B5 ["", True], _ ; 182 000000B6 ["", True], _ ; 183 000000B7 ["", True], _ ; 184 000000B8 ["", True], _ ; 185 000000B9 ["", True], _ ; 186 000000BA ["", True], _ ; 187 000000BB ["", True], _ ; 188 000000BC ["", True], _ ; 189 000000BD ["", True], _ ; 190 000000BE ["", True], _ ; 191 000000BF ["", True], _ ; 192 000000C0 ["", True], _ ; 193 000000C1 ["", True], _ ; 194 000000C2 ["", True], _ ; 195 000000C3 ["", True], _ ; 196 000000C4 ["", True], _ ; 197 000000C5 ["", True], _ ; 198 000000C6 ["", True], _ ; 199 000000C7 ["", True], _ ; 200 000000C8 ["", True], _ ; 201 000000C9 ["", True], _ ; 202 000000CA ["", True], _ ; 203 000000CB ["", True], _ ; 204 000000CC ["", True], _ ; 205 000000CD ["", True], _ ; 206 000000CE ["", True], _ ; 207 000000CF ["", True], _ ; 208 000000D0 ["", True], _ ; 209 000000D1 ["", True], _ ; 210 000000D2 ["", True], _ ; 211 000000D3 ["", True], _ ; 212 000000D4 ["", True], _ ; 213 000000D5 ["", True], _ ; 214 000000D6 ["", True], _ ; 215 000000D7 ["", True], _ ; 216 000000D8 ["", True], _ ; 217 000000D9 ["", True], _ ; 218 000000DA ["", True], _ ; 219 000000DB ["", True], _ ; 220 000000DC ["", True], _ ; 221 000000DD ["", True] _ ; 222 000000DE ] Return $aVK EndFunc ;==>_Controls Edit: it'll run commands etc but I need a way to handle the text that should not show up, like the header data. Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. We only need that to show up once and another thing is that after entering some data, every time you enter anything more the thing will throw you scrolling to the top and not let you see what you're typing, I need to fix that... Edited March 25, 2012 by ApudAngelorum
Guest Posted March 25, 2012 Posted March 25, 2012 I'm pretty interested in this, it would be good to create a UDF that would allow for embedding an interactive command processing window into a gui etc, don't you think so? I've been playing with this but am failing miserably and need to handle what happens when I hold down a key for too long, this is the best I've got for the moment, if anyone wants to help I'd appreciate it. expandcollapse popup#NoTrayIcon #include <Constants.au3> Global Const $hUSER32 = DllOpen("User32.dll") Global Const $WS_RESIZABLE = 0x00070000 Global $nMsg Global $PID Global Const $aCtrlComnds = _Controls() Global $temporariis Global $Statum Global $reversus Global $datum Global $mandatum Global $claudicatis_operatio = 0 Global $HHook Global $hKB_Hook HotKeySet("{BACKSPACE}", "CatchIt") _SetHooks(1) $PID = Run(@ComSpec, @WorkingDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $reversus &= StdoutRead($PID) If @error Then ExitLoop WEnd $temporariis = $reversus $datum = StringLen($reversus) OnAutoItExitRegister("_Exit") Opt("GUIEventOptions", 1) #region ### START Koda GUI section ### Form= $Console = GUICreate("CMD", 668, 331, 283, 173, $WS_RESIZABLE) GUIRegisterMsg(0x0024, "WM_GETMINMAXINFO") ;GUIRegisterMsg(0x0006,"Statum") GUISetIcon(@SystemDir & "cmd.exe") $hCMD = GUICtrlCreateEdit("", 0, 0, 666, 327) GUICtrlSetFont(-1, 9, 600, 0, "lucida console") GUICtrlSetColor(-1, 0xC0C0C0) GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) GUICtrlSetData($hCMD, $reversus) #endregion ### END Koda GUI section ### While 1 $Statum = WinGetState($Console) $nMsg = GUIGetMsg($Console) Switch $nMsg Case -3 Exit EndSwitch Switch $Statum Case 15 HotKeySet("{BACKSPACE}", "CatchIt") $claudicatis_operatio = 0 Case 7 HotKeySet("{BACKSPACE}") $claudicatis_operatio = 1 EndSwitch WEnd Func Exsequor($mandatum) $PID = Run(@ComSpec & " /c " & $mandatum, @WorkingDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While ProcessExists($PID) $temporariis &= StdoutRead($PID) If @error Then ExitLoop WEnd $claudicatis_operatio = 0 Return $temporariis EndFunc ;==>Exsequor Func _SetHooks($Type = False) Switch $Type Case True $hKB_Hook = DllCallbackRegister("_KeyProcess", "long", "int;wparam;lparam") If Not $hKB_Hook Then Return SetError(1, 0, False) Local $aResult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", "ptr", 0) If @error Then Return SetError(2, @error, False) $aResult = DllCall($hUSER32, "handle", "SetWindowsHookEx", _ "int", 13, _ ; WH_KEYBOARD_LL "ptr", DllCallbackGetPtr($hKB_Hook), _ "handle", $aResult[0], _ "dword", 0 _ ) If @error Then Return SetError(3, @error, False) $HHook = $aResult[0] EndSwitch Return SetError(0, 0, True) EndFunc ;==>_SetHooks Func _KeyProcess($NCode, $WParam, $LParam) Local $aResult If $NCode < 0 Then $aResult = DllCall($hUSER32, "lresult", "CallNextHookEx", "handle", $HHook, "int", $NCode, "wparam", $WParam, "lparam", $LParam) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndIf Local $kcStruc = DllStructCreate("dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo", $LParam) If Not $claudicatis_operatio Then Switch $WParam Case 256 DllCall($hUSER32, "long", "GetKeyState", "long", 0) If Not $claudicatis_operatio Then If DllStructGetData($kcStruc, "vkCode") = 13 Then $claudicatis_operatio = 1 $temporariis = Exsequor($mandatum) $mandatum = "" $reversus &= @CRLF & $temporariis $temporariis = $reversus $datum = StringLen($reversus) GUICtrlSetData($hCMD, $reversus) ;_GUICtrlEdit_AppendText($Console, $data) EndIf EndIf Case Else Local $scanCode = DllStructGetData($kcStruc, "scanCode") Local $vkCode = DllStructGetData($kcStruc, "vkCode") If $aCtrlComnds[$vkCode][1] Then;don't process control characters Local $KeyProcess = DllStructCreate("byte[256];Char") DllCall($hUSER32, "int", "GetKeyboardState", "ptr", DllStructGetPtr($KeyProcess)) If @error Then Return SetError(@error, 0, 0) DllCall($hUSER32, "int", "ToAsciiEx", _ "uint", $vkCode, _ "uint", $scanCode, _ "ptr", DllStructGetPtr($KeyProcess, 1), _ "ptr", DllStructGetPtr($KeyProcess, 2), _ "uint", 0, _ "hwnd", "" _ ) If Not @error Then $mandatum &= DllStructGetData($KeyProcess, 2) $reversus &= DllStructGetData($KeyProcess, 2) $datum = StringLen($reversus) GUICtrlSetData($hCMD, $reversus) ConsoleWrite("$mandatum>" & $mandatum & @CR) EndIf EndSwitch EndIf $aResult = DllCall($hUSER32, "lresult", "CallNextHookEx", "handle", $HHook, "int", $NCode, "wparam", $WParam, "lparam", $LParam) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndFunc ;==>_KeyProcess Func CatchIt() If (StringLen(StringTrimRight($temporariis, 1)) <= $datum - 2) Then $reversus = StringTrimRight($reversus, 1) $datum = StringLen($reversus) $mandatum = StringTrimRight($mandatum, 1) GUICtrlSetData($hCMD, $reversus) EndIf Return EndFunc ;==>CatchIt Func WM_GETMINMAXINFO($hwnd, $Msg, $WParam, $LParam) Local $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $LParam) DllStructSetData($tagMaxinfo, 7, 116) ; min X DllStructSetData($tagMaxinfo, 8, 59) ; min Y DllStructSetData($tagMaxinfo, 9, 668); max X DllStructSetData($tagMaxinfo, 10, @DesktopHeight) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFO Func _Exit() _SetHooks() DllClose($hUSER32) OnAutoItExitUnRegister("_Exit") Exit EndFunc ;==>_Exit Func _Controls() Local $aVK[223][2] = _; Key Down DEC HEX [ _ ["", True], _ ; 0 00000000 ["", True], _ ; 1 00000001 ["", True], _ ; 2 00000002 ["", True], _ ; 3 00000003 ["", True], _ ; 4 00000004 ["", True], _ ; 5 00000005 ["", True], _ ; 6 00000006 ["", True], _ ; 7 00000007 ["[BACK SPACE]", False], _ ; 8 00000008 ["[TAB]", False], _ ; 9 00000009 ["", True], _ ; 10 0000000A ["", True], _ ; 11 0000000B ["[CLEAR]", False], _ ; 12 0000000C ["[ENTER]", False], _ ; 13 0000000D ["", True], _ ; 14 0000000E ["", True], _ ; 15 0000000F ["[SHIFT]", False], _ ; 16 00000010 ["[CTRL]", False], _ ; 17 00000011 ["[ALT]", False], _ ; 18 00000012 ["[PAUSE]", False], _ ; 19 00000013 ["[CAPS LOCK]", False], _ ; 20 00000014 ["", True], _ ; 21 00000015 ["", True], _ ; 22 00000016 ["", True], _ ; 23 00000017 ["", True], _ ; 24 00000018 ["", True], _ ; 25 00000019 ["", True], _ ; 26 0000001A ["[ESC]", False], _ ; 27 0000001B ["", True], _ ; 28 0000001C ["", True], _ ; 29 0000001D ["", True], _ ; 30 0000001E ["", True], _ ; 31 0000001F ["[SPACE]", True], _ ; 32 00000020 ["[PAGE UP]", False], _ ; 33 00000021 ['[PAGE DOWN]', False], _ ; 34 00000022 ["[END]", False], _ ; 35 00000023 ["[HOME]", False], _ ; 36 00000024 ["[LEFT ARROW]", False], _ ; 37 00000025 ["[UP ARROW]", False], _ ; 38 00000026 ["[RIGHT ARROW]", False], _ ; 39 00000027 ["[DOWN ARROW]", False], _ ; 40 00000028 ["", True], _ ; 41 00000029 ["", True], _ ; 42 0000002A ["", True], _ ; 43 0000002B ["[PRINT-SCREEN]", False], _ ; 44 0000002C ["[INSERT]", False], _ ; 45 0000002D ["[DELETE]", False], _ ; 46 0000002E ["", True], _ ; 47 0000002F ["", True], _ ; 48 00000030 ["", True], _ ; 49 00000031 ["", True], _ ; 50 00000032 ["", True], _ ; 51 00000033 ["", True], _ ; 52 00000034 ["", True], _ ; 53 00000035 ["", True], _ ; 54 00000036 ["", True], _ ; 55 00000037 ["", True], _ ; 56 00000038 ["", True], _ ; 57 00000039 ["", True], _ ; 58 0000003A ["", True], _ ; 59 0000003B ["", True], _ ; 60 0000003C ["", True], _ ; 61 0000003D ["", True], _ ; 62 0000003E ["", True], _ ; 63 0000003F ["", True], _ ; 64 00000040 ["", True], _ ; 65 00000041 ["", True], _ ; 66 00000042 ["", True], _ ; 67 00000043 ["", True], _ ; 68 00000044 ["", True], _ ; 69 00000045 ["", True], _ ; 70 00000046 ["", True], _ ; 71 00000047 ["", True], _ ; 72 00000048 ["", True], _ ; 73 00000049 ["", True], _ ; 74 0000004A ["", True], _ ; 75 0000004B ["", True], _ ; 76 0000004C ["", True], _ ; 77 0000004D ["", True], _ ; 78 0000004E ["", True], _ ; 79 0000004F ["", True], _ ; 80 00000050 ["", True], _ ; 81 00000051 ["", True], _ ; 82 00000052 ["", True], _ ; 83 00000053 ["", True], _ ; 84 00000054 ["", True], _ ; 85 00000055 ["", True], _ ; 86 00000056 ["", True], _ ; 87 00000057 ["", True], _ ; 88 00000058 ["", True], _ ; 89 00000059 ["", True], _ ; 90 0000005A ["[L-WINDOWS KEY]", False], _ ; 91 0000005B ["[R-WINDOWS KEY]", False], _ ; 92 0000005C ["[APP-KEY]", False], _ ; 93 0000005D ["", True], _ ; 94 0000005E ["", True], _ ; 95 0000005F ["", True], _ ; 96 00000060 ["", True], _ ; 97 00000061 ["", True], _ ; 98 00000062 ["", True], _ ; 99 00000063 ["", True], _ ; 100 00000064 ["", True], _ ; 101 00000065 ["", True], _ ; 102 00000066 ["", True], _ ; 103 00000067 ["", True], _ ; 104 00000068 ["", True], _ ; 105 00000069 ["", True], _ ; 106 0000006A ["", True], _ ; 107 0000006B ["", True], _ ; 108 0000006C ["", True], _ ; 109 0000006D ["", True], _ ; 110 0000006E ["", True], _ ; 111 0000006F ["[F1]", False], _ ; 112 00000070 ["[F2]", False], _ ; 113 00000071 ["[F3]", False], _ ; 114 00000072 ["[F4]", False], _ ; 115 00000073 ["[F5]", False], _ ; 116 00000074 ["[F6]", False], _ ; 117 00000075 ["[F7]", False], _ ; 118 00000076 ["[F8]", False], _ ; 119 00000077 ["[F9]", False], _ ; 120 00000078 ["[F10]", False], _ ; 121 00000079 ["[F11]", False], _ ; 122 0000007A ["[F12]", False], _ ; 123 0000007B ["", True], _ ; 124 0000007C ["", True], _ ; 125 0000007D ["", True], _ ; 126 0000007E ["", True], _ ; 127 0000007F ["", True], _ ; 128 00000080 ["", True], _ ; 129 00000081 ["", True], _ ; 130 00000082 ["", True], _ ; 131 00000083 ["", True], _ ; 132 00000084 ["", True], _ ; 133 00000085 ["", True], _ ; 134 00000086 ["", True], _ ; 135 00000087 ["", True], _ ; 136 00000088 ["", True], _ ; 137 00000089 ["", True], _ ; 138 0000008A ["", True], _ ; 139 0000008B ["", True], _ ; 140 0000008C ["", True], _ ; 141 0000008D ["", True], _ ; 142 0000008E ["", True], _ ; 143 0000008F ["[NUM-LOCK]", False], _ ; 144 00000090 ["[SCROLL LOCK]", False], _ ; 145 00000091 ["", True], _ ; 146 00000092 ["", True], _ ; 147 00000093 ["", True], _ ; 148 00000094 ["", True], _ ; 149 00000095 ["", True], _ ; 150 00000096 ["", True], _ ; 151 00000097 ["", True], _ ; 152 00000098 ["", True], _ ; 153 00000099 ["", True], _ ; 154 0000009A ["", True], _ ; 155 0000009B ["", True], _ ; 156 0000009C ["", True], _ ; 157 0000009D ["", True], _ ; 158 0000009E ["", True], _ ; 159 0000009F ["[L-SHIFT]", False], _ ; 160 000000A0 ["[R-SHIFT]", False], _ ; 161 000000A1 ["[L-CTRL]", False], _ ; 162 000000A2 ["[R-CTRL]", False], _ ; 163 000000A3 ["[L-ALT]", False], _ ; 164 000000A4 ["[R-ALT]", False], _ ; 165 000000A5 ["", True], _ ; 166 000000A6 ["", True], _ ; 167 000000A7 ["", True], _ ; 168 000000A8 ["", True], _ ; 169 000000A9 ["", True], _ ; 170 000000AA ["", True], _ ; 171 000000AB ["", True], _ ; 172 000000AC ["", True], _ ; 173 000000AD ["", True], _ ; 174 000000AE ["", True], _ ; 175 000000AF ["", True], _ ; 176 000000B0 ["", True], _ ; 177 000000B1 ["", True], _ ; 178 000000B2 ["", True], _ ; 179 000000B3 ["", True], _ ; 180 000000B4 ["", True], _ ; 181 000000B5 ["", True], _ ; 182 000000B6 ["", True], _ ; 183 000000B7 ["", True], _ ; 184 000000B8 ["", True], _ ; 185 000000B9 ["", True], _ ; 186 000000BA ["", True], _ ; 187 000000BB ["", True], _ ; 188 000000BC ["", True], _ ; 189 000000BD ["", True], _ ; 190 000000BE ["", True], _ ; 191 000000BF ["", True], _ ; 192 000000C0 ["", True], _ ; 193 000000C1 ["", True], _ ; 194 000000C2 ["", True], _ ; 195 000000C3 ["", True], _ ; 196 000000C4 ["", True], _ ; 197 000000C5 ["", True], _ ; 198 000000C6 ["", True], _ ; 199 000000C7 ["", True], _ ; 200 000000C8 ["", True], _ ; 201 000000C9 ["", True], _ ; 202 000000CA ["", True], _ ; 203 000000CB ["", True], _ ; 204 000000CC ["", True], _ ; 205 000000CD ["", True], _ ; 206 000000CE ["", True], _ ; 207 000000CF ["", True], _ ; 208 000000D0 ["", True], _ ; 209 000000D1 ["", True], _ ; 210 000000D2 ["", True], _ ; 211 000000D3 ["", True], _ ; 212 000000D4 ["", True], _ ; 213 000000D5 ["", True], _ ; 214 000000D6 ["", True], _ ; 215 000000D7 ["", True], _ ; 216 000000D8 ["", True], _ ; 217 000000D9 ["", True], _ ; 218 000000DA ["", True], _ ; 219 000000DB ["", True], _ ; 220 000000DC ["", True], _ ; 221 000000DD ["", True] _ ; 222 000000DE ] Return $aVK EndFunc ;==>_Controls Edit: it'll run commands etc but I need a way to handle the text that should not show up, like the header data. Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. We only need that to show up once and another thing is that after entering some data, every time you enter anything more the thing will throw you scrolling to the top and not let you see what you're typing, I need to fix that... Wow that is great I have been playing about with fonts a bit, I will tell which one later.
Skitty Posted March 25, 2012 Posted March 25, 2012 Wow that is great I have been playing about with fonts a bit, I will tell which one later.It's pretty damn strange and annoying as F**** that what works on windows 7 performs differently on windows XP, I switched to XP just now to test it and noticed a lot more doesn't work.
Guest Posted March 25, 2012 Posted March 25, 2012 Strange. I will use XP on Monday as I will be at school on computers that are not fit for running explorer.exe! It is a great chance to debug scripts.
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