Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send a combination of keys
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Just to make sure you know, SendKeys will not work unless the window you want to send the keystrokes to is active (maybe use Window("hwnd:=" & hWnd).Activate or some other method of activating the target window). Same for Mercury.DeviceReplay, but here is the method to do it with that object (VK_MENU is Alt):

More info: Device Replay in QTP/UFT

Code:
Const VK_CONTROL = 29
Const VK_MENU = 56
Const VK_P = 25

Set deviceReplay = CreateObject("Mercury.DeviceReplay")
deviceReplay.KeyDown VK_CONTROL
deviceReplay.KeyDown VK_MENU
deviceReplay.PressKey VK_P
deviceReplay.KeyUp VK_MENU
deviceReplay.KeyUp VK_CONTROL
Reply


Messages In This Thread
Send a combination of keys - by PrabhatN - 12-09-2010, 03:40 PM
RE: Send a combination of keys - by umashekar07 - 12-10-2010, 02:17 PM
RE: Send a combination of keys - by PrabhatN - 12-13-2010, 11:33 AM
RE: Send a combination of keys - by cdesserich - 12-15-2010, 03:15 AM
RE: Send a combination of keys - by PrabhatN - 12-16-2010, 03:14 AM
RE: Send a combination of keys - by NevadaMike - 01-19-2011, 06:18 AM
RE: Send a combination of keys - by cdesserich - 01-20-2011, 10:55 AM
RE: Send a combination of keys - by NevadaMike - 01-20-2011, 10:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to press the space bar with send keys method Hari Prasad 5 25,240 06-03-2016, 10:47 AM
Last Post: Vijayaragavan.thangam
  Unable to send an email from Outlook which is already opened as draft attiliv 0 2,239 03-24-2013, 11:14 AM
Last Post: attiliv
  send arguments to qtp hadar 0 1,963 02-04-2013, 10:15 PM
Last Post: hadar
  Send key method does not set value on webEdit object. sandeep arora 1 14,605 04-05-2012, 05:27 PM
Last Post: verma.vik6
  Send Data from MSWord document 2 Excel File kisskasa 0 2,856 01-10-2012, 01:51 PM
Last Post: kisskasa

Forum Jump:


Users browsing this thread: 1 Guest(s)