In my application I create 27 dialog boxes at startup with GUI_CreateDialogBox().
I do NOT use an API function to set the dialog boxes to modal state.
Nevertheless I guess, that only the current foreground dialog box is handled in the message handler.
Reason: Timers in dialog boxes are stopped when they are pushed to background.
Therefore I see the dialog boxes as modal.
The currently required dialog box is brought to the foreground with WM_BringToTop() and WM_InvalidateWindow().
I use auto-memory-devices and the application is flicker free and reacts very fast.
No one can see the change of dialog boxes.
AND NOW THE PROBLEM COMES !
To have a popup error window I also created one at startup with WM_CreateWindow(), in the background.
It has 2 possible sizes. Both are smaller than the dialog boxes.
I inserted a hide button in it with BUTTON_CreateEx().
The reason for an error window instead of an error dialog box is, that button pressing is allowed
BOTH in the popup error window AND in the button field of the dialog box behind.
As long as the error window is in the background the application runs very fast.
But when I bring it to the foreground the application is running very slow.
The duration for bringing the error window to the top would be acceptable.
But to bring it back into the background lasts seconds.
Then everything runs with old speed.
To show the error window I use these code lines:
And to hide the error window I use these code lines:
What is the reason for this strange behavior?
Can anyone help me to speed up the application?
Our customer requires a much faster execution.
Thanks in advance
JuergenL
I do NOT use an API function to set the dialog boxes to modal state.
Nevertheless I guess, that only the current foreground dialog box is handled in the message handler.
Reason: Timers in dialog boxes are stopped when they are pushed to background.
Therefore I see the dialog boxes as modal.
The currently required dialog box is brought to the foreground with WM_BringToTop() and WM_InvalidateWindow().
I use auto-memory-devices and the application is flicker free and reacts very fast.
No one can see the change of dialog boxes.
AND NOW THE PROBLEM COMES !
To have a popup error window I also created one at startup with WM_CreateWindow(), in the background.
It has 2 possible sizes. Both are smaller than the dialog boxes.
I inserted a hide button in it with BUTTON_CreateEx().
The reason for an error window instead of an error dialog box is, that button pressing is allowed
BOTH in the popup error window AND in the button field of the dialog box behind.
As long as the error window is in the background the application runs very fast.
But when I bring it to the foreground the application is running very slow.
The duration for bringing the error window to the top would be acceptable.
But to bring it back into the background lasts seconds.
Then everything runs with old speed.
To show the error window I use these code lines:
Source Code
- WM_MoveTo(m_hWnd, m_nXpos, m_nYpos); // Moves the window to different positions
- WM_SetSize(m_hWnd, m_nWidth, m_nHeight); // Sets 1 of the 2 possible window sizes
- WM_BringToTop(m_hWnd);
- WM_SetStayOnTop(m_hWnd, 1);
- WM_ShowWindow(m_hWnd);
- WM_MoveChildTo(m_hBtnHide, ERRBTN_XPOS, m_nYposBtn); // Moves the button to the correct position
And to hide the error window I use these code lines:
What is the reason for this strange behavior?
Can anyone help me to speed up the application?
Our customer requires a much faster execution.
Thanks in advance
JuergenL