dazza Posted February 12, 2008 Share Posted February 12, 2008 Is there a way AutoIt can chew through keypresses and control clicks without being seen? Perhaps there a way to put up a splashscreen and keep it infront of everything else so hiding the executing script? Link to comment Share on other sites More sharing options...
herewasplato Posted February 12, 2008 Share Posted February 12, 2008 Welcome to the forum. Try this code:SplashTextOn("", "", @DesktopWidth, @DesktopHeight) Run("notepad") WinWaitActive("Untitled - Notepad") Send(".....") Sleep(2000) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
FreeFry Posted February 12, 2008 Share Posted February 12, 2008 Would this be a keylogger of some sort? Link to comment Share on other sites More sharing options...
DW1 Posted February 12, 2008 Share Posted February 12, 2008 @FreeFry, I don't think so, I think he is just concerned with sending, not recording. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
FreeFry Posted February 12, 2008 Share Posted February 12, 2008 I see... Link to comment Share on other sites More sharing options...
dazza Posted February 13, 2008 Author Share Posted February 13, 2008 Hmmm. This Splashscreen fn doesn't work. This is blocking the mouseclicks, controlclicks etc. on the application beneath, so nothing is being done and the script just hangs. <sigh> Thanks for the suggestion... anymore? Link to comment Share on other sites More sharing options...
TurionAltec Posted February 14, 2008 Share Posted February 14, 2008 (edited) The splash screen way should work if you use controlclick and controlsend (which are preferred anyways) but not mouseclick and sendIf you absolutely must use mouseclick and send, an ugly way might be to force the power to the monitor off. You would have to do this after every step as every mousemove or keypress will wake it up, but if you're fast enough it will turn it off before it fully woke up. As well if you have any long "sleep" periods the user might be able to wake it up. An alternative to this might be to create a separate script that will just keep shutting off the monitor in a fairly tight loop, and then terminate when told by the main script.Here's a link on powering off the monitor http://www.autoitscript.com/forum/index.ph...c=10831&hl=Here's some sample code:$WM_SYSCOMMAND = 274 $SC_MONITORPOWER = 61808 $POWERON = -1 $POWEROFF = 2 Opt('WinTitleMatchMode', 4) $hwnd = WinGetHandle('classname=Progman') DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $POWEROFF) Sleep(1000) Run("notepad") WinWaitActive("Untitled - Notepad") Send(".....") DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $POWEROFF) send("!f") DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $POWEROFF) send("x") DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $POWEROFF) Sleep(5000) DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $POWERON)You could keep a splash screen up for functions that work with it, then remove it and shut the monitor off for parts that need direct send and mouseclick.Looking at how TightVNC reacts on one of my computers, I'm quite sure the "Blank screen on client connections" just continuously turns the monitor off. Edited February 14, 2008 by TurionAltec Link to comment Share on other sites More sharing options...
herewasplato Posted February 14, 2008 Share Posted February 14, 2008 ...mouseclicks, controlclicks etc...Your first post did not mention using MouseClicks and it should work for ControlClicks.What are you attempting to do that you need to hide it from anyone? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
dazza Posted February 14, 2008 Author Share Posted February 14, 2008 Many thanks. The transfer from MouseClicks to ControlClicks and Sends to ControlSends is my first port of call; however the controls I need to click and send to are not standard it seems. The ID is always unique, and the ClassNN reads (for example) TTreeView2. I tried: ControlSend("window name", "", "[CLASSNN:TTreeview2]", "{ENTER}") ControlClick("window name", "", "[CLASSNN:TTreeview2]", "right", 1) And none work... Do I have to get the handle of the control first and then reference it? Link to comment Share on other sites More sharing options...
FreeFry Posted February 14, 2008 Share Posted February 14, 2008 It's supposed to be: ControlSend("window name", "", "TTreeview2", "{ENTER}") ControlClick("window name", "", "TTreeview2", "right", 1) Link to comment Share on other sites More sharing options...
dazza Posted February 14, 2008 Author Share Posted February 14, 2008 Many Thanks. The MouseClicks and Sends that remain are flanked by SplashScreens being put back up. Job Done. 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