Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB12.5: sending keystrokes to IE OLEObject using keybd_event function/subroutine

Status
Not open for further replies.

itek2014

Programmer
Jun 10, 2014
2
US
Hello,

In the program I am writing, I created an OLEObject to connect to a webpage in Internet Explorer that results in an automatic pop-up prompting me for my credentials. I've been trying to avoid having to switch tabs and manually click OK by instead sending the "ENTER" keystroke to the window using Sybase's keybd_event subroutine ( I declared the subroutine as an External Global Function and added the code where it was needed. The interesting thing is is that the program successfully presses the OK button in the pop-up window when I step through each line in debugger mode, but it fails to do so when I compile and run it. Could anyone give any suggestions as to how to fix this?

Thanks!
 
Matt, I checked again and the IE window is not actually active. I tried using the Handle and SetFocus functions to fix this, but neither worked. Someone suggested to me that the reason was because the IE window is not a PowerBuilder object and thus cannot be controlled using those methods. Is there another way to bring the window into focus?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top