Jump to content
  • Advertisement
Sign in to follow this  
imadoki

Switching Windows

This topic is 4488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, so I am working on this program and when the time comes, the app launches an older app through which the user has to input his or her name, etc. The problem is after it is done, I want to go back to the original app. I tried, SetForegroundWindow, SwitchToThisWindow, but I am failing badly. Basically my question is: I want to store the current topMostWindow, run another app, do something, then set focus back to the previous topMostWindow, how do I do this in plain windows HWND and stuff? Please help.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Yuck! What an ugly design. What is going to keep the user from toggling back to your program before finishing the entry in the other program? I am assuming that your program NEEDS the information from the other program before it can continue any further, so won't your program blow up?

Why can't you simply create a modal window in your program, asking for the values you need? That is a MUCH simpler solution. Heck, you could probably even figure out a way to send that info to the other program and still have something easier to manage than your proposition.

But if you are determined to go the way you are headed, you probably need to investigate hooks, and specifically watch for the program to be destroyed, at which time you would do a 'SetWindowPos' call, or something like it.

Share this post


Link to post
Share on other sites
This is just a stop gap measure till we roll out our new client/server. The old one was written by 1 programmer who does not work here anymore and half the source code is junk. So, till we roll out the new version, we are in a fix.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!