Link to home
Start Free TrialLog in
Avatar of jpalumbos
jpalumbosFlag for United States of America

asked on

How can i force my app to lose focus?

I'm using VB 6.0.
In my app, I want to send a character to another application. I know how to stuff the buffer, but I need to lose focus 1st, so the other app gets it.

When the button is selected, I want to:
- pause for a bit
- Lose focus (to pass control to whatever app was opened previously)
- Put the char in the buffer, so the other app will read it
- keep my app running, but w/o focus.
Avatar of lunchbyte
lunchbyte

I do not know how to set focus to other application without bring that application to front and cover yours.

Sometime I want none of the textboxes and buttons to have the focus so I set the focus to the form. Since form does not display anything that indicate it has focus except for the blue title bar on top, this will keep it top order if that is what you need.

Form.setfocus

Avatar of jpalumbos

ASKER

I might not have stated my original problem correctly:

I need my app to lose focus (or minimize), and the app that's currently 2nd in the order to get focus.

This can (usually) be done manually by typing <Alt>-Tab. Is there a way to do this in my VB program?
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial