How to reposition Modeless Dialog box on resizing application window
-
Hai all, I use a modeless dialog box in my application. when I resize the application window, I can not change the position of the modeless dialog box, correspondingly. How can i prevent it? Also, the window for the modeless dialog in the task bar is also seen. Simply, I am trying to make the Modeless Dialog box to be a part of my application window. Please help me, With Thanks and Rgds, Arun
-
Hai all, I use a modeless dialog box in my application. when I resize the application window, I can not change the position of the modeless dialog box, correspondingly. How can i prevent it? Also, the window for the modeless dialog in the task bar is also seen. Simply, I am trying to make the Modeless Dialog box to be a part of my application window. Please help me, With Thanks and Rgds, Arun
If my understanding of your problem is correct, you are trying to use a modeless dialog to look as if its a "pane" within your application. If this is correct, read on: 1. Make the dialog a CHILD dialog 2. In the parent window, handle the WM_SIZE message and then merely resize the child dialog. For example (a WTL eg):
void OnSize(UINT uiCode, CSize sz) { CRect rect; GetClientRect(&rect); if ( ::IsWindow(m_MyChildDialog.m_hWnd) ) { // do some manipulation on the rect if needed... rect.DeflateRect(10,10,10,10); // here I'm just decreasing the overall size of the rect m_MyChildDialog.MoveWindow(&rect); } }
That should be all you need to do. Let me know if I've missed your question completely. Cheers, Peter
controlSHIFT [Glossary Manager] [AfterThought Backup Lite] All good things were meant to be improved