Ever wondered, why e.g. an animation (or other time-critical processing) "stalls" -
when a given Forms Caption-Area is clicked with e.g. the right MouseButton?
From what I've googled, MS seems to have implemented a special MessageLoop which gets triggered,
when you click on such NonClient (NC) areas (including the Min, Max, Close-Buttons on a Form-Window).
Well, below comes a zipped solution, which prevents that (via a SubClassing-Handler, basically like this):
Although the example-zip below is using RC6-WidgetForms (using the built-in RC6-SubClasser),
the demonstrated solution should be easy enough to apply also to "normal VB-Forms" -
using ones own, preferred SubClasser.
Here's the Demo-Zip: NCAreaBlocking.zip
(which uses a simple Counter, reflected in the Forms.Caption, to simulate "animated progress")
HTH
Olaf
when a given Forms Caption-Area is clicked with e.g. the right MouseButton?
From what I've googled, MS seems to have implemented a special MessageLoop which gets triggered,
when you click on such NonClient (NC) areas (including the Min, Max, Close-Buttons on a Form-Window).
Well, below comes a zipped solution, which prevents that (via a SubClassing-Handler, basically like this):
Code:
Select Case Msg
Case WM_NCLBUTTONDOWN, WM_NCRBUTTONDOWN
'...
Select Case wParam 'don't call the DefaultWinProc in case of the following NC-HitTest-results
Case HTCAPTION, HTMINBUTTON, HTMAXBUTTON, HTCLOSE: Exit Sub
End Select
'...
the demonstrated solution should be easy enough to apply also to "normal VB-Forms" -
using ones own, preferred SubClasser.
Here's the Demo-Zip: NCAreaBlocking.zip
(which uses a simple Counter, reflected in the Forms.Caption, to simulate "animated progress")
HTH
Olaf