Accessing windows using menu items
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, My app has a bunch of menu items in which I would like to bring up different windows. One of the windows has an option that when checked and "ok" is hit will bring up another window. This (2nd)window also has its own menu selection that will bring it up. My problem is that if i display the (2nd) window and then bring up the other (1st) window that allows me to check if i want to see the information and hit "ok", it creates the same exact window. How can I get it to check if there is a window already open and just set focus to it? I am currently using this code:
if (m_pStats== NULL) { m_pStats= new CStats; if (m_pStats->Create(IDD_STATS) == TRUE) m_pStats->ShowWindow(SW_SHOW); } else m_pStats->SetActiveWindow();
Can someone walk me through this and help me with this. I am extremely new to programming and would like to figure this out ASAP! THANKS IN ADVANCE!