jeffreygoines
January 18th, 2008, 07:59 AM
hi i'm tyring to create a dialogbox-based application that pops up another window.
I know a modeless dialogbox can pop up from a overlapped/popup window and succeeded before.
What i'm trying to do now is the reverse.
The design is like this:
When some button on the dialogbox is pressed, following will be executed:
onButton() {
CreateWindowEx(...)
ShowWindow(hWnd);
}
but this doesn't work. The "normal" window i want to pop up
just disappears in a moment...like 0.1s?
The strange thing is, when
CreateWindowEx();
is executed in WinMain(), before clicking on the button,
and only the following is executed on clicking the button,
ShowWindow(hWnd);
the window does appear.
But i cannot use the second method because in the actual code
the number of windows to pop up is not given in compile time.
So the CreateWindowEx() must be called after button-clicking.
What i want to know is if this behavior of dialogbox is normal.
I guess some messages to the normal window are interrupted by the dialogbox
I know a modeless dialogbox can pop up from a overlapped/popup window and succeeded before.
What i'm trying to do now is the reverse.
The design is like this:
When some button on the dialogbox is pressed, following will be executed:
onButton() {
CreateWindowEx(...)
ShowWindow(hWnd);
}
but this doesn't work. The "normal" window i want to pop up
just disappears in a moment...like 0.1s?
The strange thing is, when
CreateWindowEx();
is executed in WinMain(), before clicking on the button,
and only the following is executed on clicking the button,
ShowWindow(hWnd);
the window does appear.
But i cannot use the second method because in the actual code
the number of windows to pop up is not given in compile time.
So the CreateWindowEx() must be called after button-clicking.
What i want to know is if this behavior of dialogbox is normal.
I guess some messages to the normal window are interrupted by the dialogbox