presskey with api

Posted on 2000-03-20
Last Modified: 2008-03-17
I want to simulate a keypress when a window with a certain classID has focus.  I think I get the findwindow(), but I'm having trouble with the keypress.  Sorry, the points are so low, I'm almost out :(
Question by:fibdev
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 32

Accepted Solution

Erick37 earned 10 total points
ID: 2638456
Once the window has focus you can use VB's SendKeys function.

Author Comment

ID: 2640607
I can't find SendKeys anywhere in the Win32API?
LVL 32

Expert Comment

ID: 2640659
SendKeys is a VB command.

SendKeys "Text to send"

SendKeys "{ENTER}"

You will find it in VB Help.

Author Comment

ID: 2640667
Thanks Erick

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question