sendkeys

Excel Automatically Open Dropdown List with Focus / NumLock issue

牧云@^-^@ 提交于 2019-12-06 15:13:54
问题 I have a group of cells in my worksheet that use a data validation list. It works great, but I'd like the list to dropdown automatically when one of these cells gets the focus. I found some code online to make this work. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) If Target.Worksheet.Name = "Sheet1" And Target.Column = 1 Then Application.SendKeys ("%{down}") End If End Sub Courtesy of: http://howoffice.com/automatically-open-the-drop-down-list-when-a

Send keys without SendMessage and PostMessage

两盒软妹~` 提交于 2019-12-06 14:52:10
Is it possible to send keys to a program without SendMessage and PostMessage API? The official way to fake input does not involve sending or posting Windows messages directly. Instead you are meant to call SendInput . When you use SendInput it is indistinguishable from actually pressing the real keys. When you call SendInput to fake keyboard input, the system ultimately posts messages to the message queue of the foreground thread that created the window with the keyboard focus. 来源: https://stackoverflow.com/questions/10106725/send-keys-without-sendmessage-and-postmessage

sending ctrl+c using sendkeys in ruby

送分小仙女□ 提交于 2019-12-06 14:13:43
I need to close the command prompt window using sendkeys function, but when I used the below code it did not work as running of some betch file is in progress so its not taking these below options. require 'win32ole' system("start cmd.exe") sleep(5) # Create an instance of the Wscript Shell: wsh = WIN32OLE.new('Wscript.Shell') # Try to activate the command window: if wsh.AppActivate('cmd.exe') sleep(1) wsh.SendKeys('cd \\') wsh.SendKeys('{ENTER}') # change the directory path where mtn folder is residing wsh.SendKeys('cd ') wsh.SendKeys "C://mtn-3//mtn-2.2//" wsh.SendKeys('{ENTER}') wsh

Sending Key Strokes with C# in Win10 outside of app

折月煮酒 提交于 2019-12-06 10:35:10
I am trying to send a simple "CTRL+C" stroke to another window. The idea is to grab text from IE/FF/Chrome/IE/Excel/Word . Anyway, I have tried to use SendKeys.Send() and SendKeys.SendWait() and InputSimulator's Keyboard.KeyPress() . None of them throw exceptions (Well SendKeys.Send() , but that's expected) but none of them actually send anything. I have tried to just send letter presses and nothing happens. I will include code snippets to see if maybe I am doing something real dense but I worry its a Win10 isolation thing. Has anyone had luck sending keystrokes outside of their own app in

Sending '@' special character with SendKeys to IE 11

风流意气都作罢 提交于 2019-12-06 10:11:31
I'm trying to send a special character to a textbox using the SendKeys method in Internet Explorer 11. I didn't have this problem while trying to send special characters in other browsers, but Internet Explorer is sending completely different characters when trying to send special characters. Most of the specials characters do work (e.g. !#()$%&/) but the characters like @{}§ are not working, and instead of those characters, something like vbnm is written in the textbox. These letters represents the keys with which the special signs are created in combination with the key Alt Gr (e.g. Alt Gr +

How can I debug SendKeysCtypes on (win7 64bit, py2.7) further?

旧巷老猫 提交于 2019-12-06 09:41:53
Im trying to get SendKeysCtypes working on py2.7 and win7 64bit . Here is src Problem: Run SendKeysCtypes.py and nothing happens. Tests should open notepad and write some text. The problem code is this: def GetInput(self): "Build the INPUT structure for the action" actions = 1 # if both up and down if self.up and self.down: actions = 2 inputs = (INPUT * actions)() vk, scan, flags = self._get_key_info() for inp in inputs: inp.type = INPUT_KEYBOARD inp._.ki.wVk = vk inp._.ki.wScan = scan inp._.ki.dwFlags |= flags # if we are releasing - then let it up if self.up: inputs[-1]._.ki.dwFlags |=

C# SendKeys.SendWait to a dialog of another Process (notepad.exe)

北慕城南 提交于 2019-12-06 04:57:56
I'm trying to do the following in C#: Open a new process (notepad.exe) Enter some text (using SendKeys) Close Notepad (deal with any confirmation dialogs) Here's what I got Process p = new Process(); p.StartInfo.Filename = "notepad.exe"; p.Start(); // use the user32.dll SetForegroundWindow method SetForegroundWindow( p.MainWindowHandle ); // make sure notepad has focus SendKeys.SendWait( "some text" ); SendKeys.SendWait( "%f" ); // send ALT+f SendKeys.SendWait( "x" ); // send x = exit // a confirmation dialog appears All this works just as expected, but now after I've sent ALT+f+x I get a "Do

Press save button of “File download dialog” of internet explorer via c#

纵饮孤独 提交于 2019-12-06 03:29:15
问题 I am working on internet explorer automation and part of it involves downloading files from a site whcih is hosted on asp 2.0 and uses forms based authentication, so to create end to end automation I used browser automation. I was able to reach to the step where I can get to click on a URL which brings the "File Download" dialog of the browser, then I was trying to make use of SendKeys to click on the save button but to no avail it was not working. Here is the code where I make use of

How to send unicode keys with c++ (keybd_event)

喜夏-厌秋 提交于 2019-12-06 01:40:06
问题 My friend is learning Norwegian and i want to make a global hot key program which sends keys such as æ ø å My problem is that keybd_event function wont allow me to send those keys, i seem to be restricted to the virtual key codes is there another function that i could use or some trick to sending them? 回答1: You have to use SendInput instead. keybd_event does not support sending such characters (except if they are already in the current codepage, like on Norwegian computers). A bit of sample

Vb.net sendkeys, letters duplicate?

孤街醉人 提交于 2019-12-05 17:49:36
问题 I created a simple test with SendKeys, and tried both SendWait and Send. Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click System.Threading.Thread.Sleep(10000) SendKeys.SendWait("If you can read this, it works." + "{ENTER}") End Sub I tested in skype, and a few of the letters doubled. I tested in Flash, I got "Iffff yyouu cccaaaannn rrreaaaddd thhhiiisss,,, iiittt wwwooorrrrkkks." Clearly the issue is caused by lag. What can I do to prevent doubling