This is one of those weird errors that probably nobody knows of, but I will try anyway, maybe somebody knows...
I designed a datepicker as a drop-down control. When the control drops the floating form calendar is displayed. One can press the year and a numeric up-down appears where you can change the year. All controls are inherited and I override the WndProc and handle all mouse message so that no one of the controls gets focus, in this way the main form never looses focus when the control is dropped-down. All is fine except for the following situation: when the application starts the control is not focused. The control is then either clicked or tabbed to. If you click the year the numeric up down appears. Here is what happens: one of the buttons of the numeric up down generates an error in the WndProc on the WM_PAINT message. The error is the windows error #33: ERROR_LOCK_VIOLATION. What is extremely weird is: both buttons (up and down) are of the same exact type and they both created and dealt with in the same manner. Still only one has this strange behavior. Also, if one presses the tab key a few times and the focus goes away from the control and then returns to it... no error occurs... What can be the problem??
The floating form is a form with a custom control on it who owns the numeric up-down. The form is shown using the SetWindowPos api...
If anybody has any idea, or suggestions?
thank you,
iulian