[Last Call] Learn how to a build a cloud-first strategyRegister Now


messages in  c#

Posted on 2011-10-21
Medium Priority
Last Modified: 2013-12-16
I have a winform form window open and want to set focus to it if it is not visible. Can I ]post a user message to its message pump?
Question by:BushBill
LVL 47

Expert Comment

ID: 37007435

check if the  solution of this question could help you to bring it forth:
LVL 86

Accepted Solution

Mike Tomlinson earned 200 total points
ID: 37007692
Is another window in YOUR application currently focused?  If yes, then you can simply use BringToFront():


If another application is currently focused then you may or may not need to resort to APIs as in the previous post.  It really depends on the Windows version and whether they have it set to prevent other applications from stealing focus.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

829 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