How can i force my app to lose focus?

Posted on 2006-05-23
Last Modified: 2008-02-26
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.
Question by:jpalumbos
    LVL 5

    Expert Comment

    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.



    Author Comment

    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?

    Author Comment


    Accepted Solution

    Closed, 200 points refunded.

    The Experts Exchange
    Community Support Moderator of all Ages

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    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…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now