Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stoping the mouse !

0 views
Skip to first unread message

Peter Klumm

unread,
May 5, 1998, 3:00:00 AM5/5/98
to

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 ?

Im open to any suggestions

Thanx in advance, Peter ( sam...@moderntimes.de )


Boudewijn

unread,
May 5, 1998, 3:00:00 AM5/5/98
to


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

Thomas Siewert

unread,
May 6, 1998, 3:00:00 AM5/6/98
to

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


Matt Griffiths

unread,
May 6, 1998, 3:00:00 AM5/6/98
to

Hi
If I have interpreted your question correctly - wouldn't it be politer
(and simpler) to pop-up a modal form whilst the app is processing in
the background ? - Perhaps even an AVI to pass the time ? - (There
seems to be lots of links to AVI's from this group recently!!-
Although they are probably not the ones you would be using :o) )

Hope this helps

Regards

Matt

On Tue, 5 May 1998 10:05:20 +0200, "Peter Klumm" <in...@moderntimes.de>
wrote:

Josh D

unread,
May 6, 1998, 3:00:00 AM5/6/98
to

The simplest way to keep the user from sending any more clicks to your
application is to set the mousepointer to an hourglass.

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 ?
>

SunShine

unread,
May 6, 1998, 3:00:00 AM5/6/98
to

This is just a trick to make then user think he can't do anything, but of
course he still can.

CU,
Sun

-------------------------------------------------------------------------
E-mail: tobig...@t-online.de
Homepage: http://home.t-online.de/home/tobigeimer

Thomas Siewert

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Ok, there´s an other way to stop it

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 ...

0 new messages