Xand3r Posted April 23, 2009 Share Posted April 23, 2009 is there any way to mask characters when reading from the cmd input?(fileopen("con" ,4)) Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
torels Posted April 23, 2009 Share Posted April 23, 2009 the only EASY way I can think of is via HotKeys... Or maybe some WinApi command... but I'm not sure (actually just setting the test the same color as the background will work fine ... but yet, I don't know how to do it XD) Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
spudw2k Posted April 23, 2009 Share Posted April 23, 2009 (edited) All the inet searches I came across all referred to hooking of some sort. I made a crude example using code from the _WinAPI_SetWindowsHookEx() example in the help file and tailored it to run as a CUI. Works ok, but not the best and is incomplete.I'm happy to PM it to you if you're interested in looking.edit:I was waiting to post the code as it could be altered for bad intent, but since zorphnog already did....here ya go. Must be compiled.test.au3 Edited April 23, 2009 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
zorphnog Posted April 23, 2009 Share Posted April 23, 2009 Here's an example I made from modifying the _WinAPI_SetWindowsHookEx example using notepad as the input. Of course you would need to make some changes for interacting with the console input, but it shows the basic idea of what you have to do. If you post your code, we can try to tailor it for your needs. expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <WinAPI.au3> #include <WindowsConstants.au3> #include <StructureConstants.au3> Opt('MustDeclareVars', 1) Global $hHook, $hStub_KeyProc, $buffer = "" _Main() Func _Main() Local $hmod $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam") $hmod = _WinAPI_GetModuleHandle("user32.dll") $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod) Run("Notepad") WinWait("Untitled -") WinActivate("Untitled -") While 1 If ControlGetText("Untitled -", "", "Edit1") <> "" Then ControlSetText("Untitled -", "", "Edit1", "") Sleep(10) WEnd EndFunc ;==>_Main Func EvaluateKey($keycode) If ($keycode = 27) Then ConsoleWrite($buffer & @LF) Exit EndIf $buffer &= Chr($keycode) EndFunc ;==>EvaluateKey ;=========================================================== ; callback function ;=========================================================== Func _KeyProc($nCode, $wParam, $lParam) Local $tKEYHOOKS $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndIf If $wParam = $WM_KEYDOWN Then EvaluateKey(DllStructGetData($tKEYHOOKS, "vkCode")) EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc ;==>_KeyProc Func OnAutoItExit() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_KeyProc) EndFunc ;==>OnAutoItExit 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