• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Restore Window MFC ?

larva

Member
Hi Folks,

I am developing an application (A1) and this application need to restore the window of second program anytime i click on a button on A1. Is there any function that I can use to do this ? I m using MS Visual C++ 6.0. Grateful if you can help, Thanks !

regards,
Mark
 
Once you locate the main window of App #2
ShowWindow(SW_RESTORE)

will handle your problem
 
Hi EagleKeeper,

I don't really understand how to use the ShowWindow(SW_RESTORE) you mentioned. For instance, if my App #2 is located at c:\window\app2.exe, how do I enter this so that it will restore this App #2 window instead of executing it again ? Thank you very much for your feedback !

One more question is that how can I adjust the font size on a button with resizing the button with MS Visual C++ ?

regards,
Larva
 
First you use FindWindow to get a window handle to the window you want - it uses the class name to find it, and/or the window name.

with the window handle you can:

hwnd = FindWindow(lpClassName, lpWindowName);
ShowWindow(hwnd, SW_RESTORE);

lpWindowName can be NULL, in which case only the ClassName is searched.

Edit: A few code typos. (forgot one closing parenthesis)
 
Back
Top