Restore Window MFC ?

larva

Member
Jul 15, 2001
185
0
0
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
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Once you locate the main window of App #2
ShowWindow(SW_RESTORE)

will handle your problem
 

larva

Member
Jul 15, 2001
185
0
0
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
 

RSMemphis

Golden Member
Oct 6, 2001
1,521
0
0
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)