How to bring an application to the front?

D

Don

I have two programs. One is supposed to bring the other (which is already
running either minimized or at the bottom of the window z-order) to the
front so that it becomes the foremost application. How do you do this?
I've tried using the API functions BringWindowToTop, SetForegroundWindow,
and SetWindowPos and can't get any of them to work reliably.
BringWindowToTop and SetForegroundWindow don't do anything, and SetWindowPos
only seems to work sometimes.

Does anyone have any code examples of how to bring a window to the front of
all other windows (of all applications, not just the application the window
is in)?

- Don
 
D

Don

It appears as though the "Prevent applications from stealing focus" option
in TweakUI is hampering my efforts. When I turned that off, I managed to
get it working fine.

- Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top