Original Post
I have 2 dialog box classes, both modal, initiated with DialogBox(...). Dialog1 can call Dialog2 by new'ing an instance of Dialog2 and calling Dialog2's DoModal() function (which just calls DialogBox(..) ). (I delete the Dialog2 instance after it returns)
Dialog2 allows selection of a file using the common controls GetOpenFileName.
When I select a file in Dialog2 (using GetOpenFileName) and close Dialog2, it returns to Dialog1 okay. However, the 2nd time I call Dialog2, the Dialog2 window does not come to the top of the z-order. Dialog2's OnInitDialog get called but WM_NCPAINT isn't called until I can click on the Windows taskbar for the main app and then Dialog2 will appear.
The "hidden" behavior of Dialog2 occurs only if GetOpenFileName is called from Dialog2. But then it occurs every time Dialog2 is invoked after that (unless I close and reopen Dialog1).
It appears that invoking GetOpenFileName, for some reason, affects the focus of Dialog2 the next time it's instantiated and run. I've tried setting the owner of the GetOpenFileName window to both the dialog and NULL.
Anyone know why this occurs?
EDIT: apologies - posted to wrong forum - moderator notified.
[Edited by - Buckeye on July 17, 2010 6:47:40 AM]
Dialog2 allows selection of a file using the common controls GetOpenFileName.
When I select a file in Dialog2 (using GetOpenFileName) and close Dialog2, it returns to Dialog1 okay. However, the 2nd time I call Dialog2, the Dialog2 window does not come to the top of the z-order. Dialog2's OnInitDialog get called but WM_NCPAINT isn't called until I can click on the Windows taskbar for the main app and then Dialog2 will appear.
The "hidden" behavior of Dialog2 occurs only if GetOpenFileName is called from Dialog2. But then it occurs every time Dialog2 is invoked after that (unless I close and reopen Dialog1).
It appears that invoking GetOpenFileName, for some reason, affects the focus of Dialog2 the next time it's instantiated and run. I've tried setting the owner of the GetOpenFileName window to both the dialog and NULL.
Anyone know why this occurs?
EDIT: apologies - posted to wrong forum - moderator notified.
[Edited by - Buckeye on July 17, 2010 6:47:40 AM]