gbr Posted December 13, 2011 Share Posted December 13, 2011 Hi, I am using Send(#r) and Send(#d) to start Run and to go to desktop. But how to simulate them using ControlSend Link to comment Share on other sites More sharing options...
shornw Posted December 13, 2011 Share Posted December 13, 2011 Not really clear what you are asking. {CTRLDOWN} will hold the CTRL key down until {CTRLUP} is sent - is that what you're trying to do? [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
Akarillon Posted December 13, 2011 Share Posted December 13, 2011 I've tried to use the ControlSend to do the same thing, but not succeeded.. Why do you need to use ControlSend instead of Send? Challenge accepted! Link to comment Share on other sites More sharing options...
willichan Posted December 13, 2011 Share Posted December 13, 2011 ControlSend() is for sending keys to a particular control. Since key combinations like Win+r or Win+d go to the OS, it does not make sense to pass them to a particular control. For those cases, you should use Send(). If those were just examples, and you are wanting to send keystrokes (in general) to a control, ControlSend("Title of window control is in", "optional text to further identify the window the control is in", "The ID (name) of the control", "keys to send", 1) ; the final parameter (1) is the same as in Send() to tell autoit to use the "Raw" keys style in your example. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
gbr Posted December 14, 2011 Author Share Posted December 14, 2011 Hi All:Thanks a lot for the replies!!!The AutoIt script is not working on the Locked workstations but I need that as I am running the scripts overnight. I read in the AutoIt wiki that:Q: Why doesn't my script work on a locked workstation?A: On locked station any window will never be active (active is only dialog with text "Press Ctrl+Alt+Del") In Windows locked state applications runs hidden (behind that visible dialog) and haven't focus and active status. So generally don't use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc. Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc. This way you may have your script resistive against another active windows. It's possible to run such script from scheduler on locked Windows station. Hence I am trying to use the ControlSend(). My script has commands like Send("#d") and Send("#r") which works normally but fails to start overnight (on a locked workstation)Any suggestations!!! Link to comment Share on other sites More sharing options...
BrewManNH Posted December 14, 2011 Share Posted December 14, 2011 There's absolutely no reason to use the Send command (or by extension ControlSend) to run a program. Use the Run() command and skip using the Start menu run command box to do it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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