Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Postmessage function in QTP for simulating Printscreen key does not work
#1
Not Solved
I am using the following code to simulate a PrintScreen button press to capture the image of a Internet Explorer window. I have assigned Printscreen as a Hotkey in Greenshot tool to capture the image of the full page in one go without having to scroll.

Code:
Extern.Declare micLong, "PostMessage", "user32.dll", "PostMessageA", micHwnd, micLong, micLong, micLong

Const WM_KEYDOWN = 273
Const VK_SNAPSHOT = 44

iResult = Extern.PostMessage( Hwnd, WM_KEYDOWN, VK_SNAPSHOT, 0)
But somehow the value of iResult is always 1. Hwnd is the actual window handle of the Internet explorer window which is passed to the Postmessage function. The reason why I am using this approach is because the screenshot capturing process needs to be automated completely and should run when the system is locked as well. SendKeys does not work when system is locked and so I had to move to Post Message.

Could someone please help me out with this.
Reply


Messages In This Thread
Postmessage function in QTP for simulating Printscreen key does not work - by steelbird - 07-11-2013, 09:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question what is the shortcut key used to switch between keyword view and expert view in qtp. shaileshanand86 5 11,283 02-13-2019, 03:58 AM
Last Post: zia003
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,781 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  Facing issue with Java Table to press Enter Key from Keyboard Nasir Ahmed 0 4,392 05-23-2014, 08:05 PM
Last Post: Nasir Ahmed
  unable to click webelement by holding shift key tanyamrz 1 3,364 09-14-2012, 05:21 AM
Last Post: kcn
  Send key method does not set value on webEdit object. sandeep arora 1 14,394 04-05-2012, 05:27 PM
Last Post: verma.vik6

Forum Jump:


Users browsing this thread: 1 Guest(s)