Can I "disable" the mouse for a certain time...
My Problem is as follows: When I click an a picture on my form there are
certain things the program is doing until the user can continue to work. In
that mean time the user can click again and again, and is so able to run the
program into some very unstable status, because normally the picture he is
clicking is no longer valid ... Sounds weird and even looks weird, too. One
way for me was to disable all forms after the click event and do a doEvents
before I enable everything again, but I think it would be much nicer to
disable the mouse so all clicks arent "buffered" at all...
Is there maybe some kind of API-Call ?
Im open to any suggestions
Thanx in advance, Peter ( sam...@moderntimes.de )
Peter Klumm <in...@moderntimes.de> wrote in article
<uZHOOw$d9GA...@uppssnewspub05.moswest.msn.net>...
> Hi,
> is there a way to make the mouse stop sending any clicks...
>
> Can I "disable" the mouse for a certain time...
>
> My Problem is as follows: When I click an a picture on my form there are
> certain things the program is doing until the user can continue to work.
In
> that mean time the user can click again and again, and is so able to run
the
> program into some very unstable status, because normally the picture he
is
> clicking is no longer valid ...
[snip]
> Is there maybe some kind of API-Call ?
Peter,
i'd say the neatest way to do it is make a boolean
Private m_bDoingMyStuff as Boolean
place this before all the Eventhandlers and subs on your form, that way
it's valid for all procedures
Now edit Picture1_Click():
...
if m_bDoingMyStuff then
exit sub
else
m_bDoingMyStuff =true
....
' your code goes here
...
m_bDoingMyStuff =False
End if
Hi,
there are several API functions to solve your problem.
Try to start a function like this:
in a module:
Public Const WM_MOUSEFIRST = &H200
Public Const WM_MOUSELAST = &H209
any where:
Public Function fcnDoNothing()
Dim Hmsg As MSG
Dim fTrack As Boolean
While GetMessage(Hmsg, 0&, 0, 0)
If Hmsg.message >= WM_MOUSEFIRST and Hmsg.message <= WM_MOUSELAST then
'Do Nothing
Else
x = PostMessage(Hmsg.hWnd, Hmsg.message, Hmsg.wParam, Hmsg.lParam)
End If
DoEvents
Wend
End Function
Hope this helps
Regards
Matt
On Tue, 5 May 1998 10:05:20 +0200, "Peter Klumm" <in...@moderntimes.de>
wrote:
MousePointer = vbHourGlass
'your processing code here
MousePointer = vbDefault
Works for me every time!
Good luck!
Josh
Peter Klumm wrote in message ...
>Hi,
>is there a way to make the mouse stop sending any clicks...
>
>Can I "disable" the mouse for a certain time...
>
>My Problem is as follows: When I click an a picture on my form there are
>certain things the program is doing until the user can continue to work. In
>that mean time the user can click again and again, and is so able to run
the
>program into some very unstable status, because normally the picture he is
>clicking is no longer valid ... Sounds weird and even looks weird, too. One
>way for me was to disable all forms after the click event and do a doEvents
>before I enable everything again, but I think it would be much nicer to
>disable the mouse so all clicks arent "buffered" at all...
>
>Is there maybe some kind of API-Call ?
>
CU,
Sun
-------------------------------------------------------------------------
E-mail: tobig...@t-online.de
Homepage: http://home.t-online.de/home/tobigeimer
If you´re using VB 5.0 search in the Online-Documentation for ´Address Of´.
There is an example for subclassing, try it.
Use this functions to examine the mouse position using the API-calls
ScreentoClient and ClienttoScreen.
Tom
Peter Klumm schrieb in Nachricht ...