handle to a child window
-
Hi, Mine is a SDI application with different form views.I have button controls in the form views.When clicked on these buttons some dilaogs will open.How to get the handle to the child window which is opened when clicked on buttons. Thanks.
-
ya that is true but,I had another problem i.e when i opened a dilaog from one of the views and opened a dilaog from the tray menu option with out closing the first one.So,i will have two modal dilaogs opened.Now when i close one window,i am able to access the main window even though one modal dialog is opened,which is a odd behavior.So,i want to get the handle of the child window,which remained when i close one of the window's and disable the main window untill the child window is closed.Is it correct or there is any other option. Thanks
-
ya that is true but,I had another problem i.e when i opened a dilaog from one of the views and opened a dilaog from the tray menu option with out closing the first one.So,i will have two modal dilaogs opened.Now when i close one window,i am able to access the main window even though one modal dialog is opened,which is a odd behavior.So,i want to get the handle of the child window,which remained when i close one of the window's and disable the main window untill the child window is closed.Is it correct or there is any other option. Thanks
Is it good to show two modal dialogs at the same time? From my point of view, I dont like it... anyway I am not sure about your requirements. So I think your idea of disabling the main window is not bad. Then you will get the window handle from dialog object if it is set as global or member object.
- NS -
-
Is it good to show two modal dialogs at the same time? From my point of view, I dont like it... anyway I am not sure about your requirements. So I think your idea of disabling the main window is not bad. Then you will get the window handle from dialog object if it is set as global or member object.
- NS -
-
ya that is true but,I had another problem i.e when i opened a dilaog from one of the views and opened a dilaog from the tray menu option with out closing the first one.So,i will have two modal dilaogs opened.Now when i close one window,i am able to access the main window even though one modal dialog is opened,which is a odd behavior.So,i want to get the handle of the child window,which remained when i close one of the window's and disable the main window untill the child window is closed.Is it correct or there is any other option. Thanks
In my opinion your problem isn't in the main window. When you display a Modal Dialog from the main window, it will automatically apply the WS_DISABLED style to the main window (check it out using the Spy++ tool), so what you propose really won't make any difference. Your problem is in the handler for the tray menu, where you are allowing the selecting of the menu option to open another modal dialog even though the main window is disabled. Your tray menu handler should process WM_INITMENU and check whether or not the main window is disabled and enable menu options accordingly.