INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

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

(OP)
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 (http://www.sybase.com/detail?id=47760). 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!

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

Are you sure the other apps window is active at the time you trigger the keypress?

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

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

(OP)
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?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close