1. Cool WinAPI procedure, check it out!

The blockInput procedure blocks keyboard and mouse input events from
reaching applications.

The code for it is as follows:
include win32lib.ew

constant xBlockInput=registerw32Procedure(user32,"BlockInput",{C_INT})

global procedure blockInput(atom fBlockIt) --1 for block, 0 for unblock
w32Proc(xBlockInput,{fBlockIt})
end procedure


Remarks:
When input is blocked, real physical input from the mouse or keyboard will
not affect the input queue's synchronous key state (reported by GetKeyState
and GetKeyboardState), nor will it affect the asynchronous key state
(reported by GetAsyncKeyState). However, the thread that is blocking input
can affect both of these key states by calling SendInput. No other thread
can do this.

The system will unblock input in the following cases:


The thread that blocked input unexpectedly exits without calling BlockInput
with fBlock set to FALSE. In this case, the system cleans up properly and
re-enables input.
<li>Windows 95/98/Me: The system displays the Close Program/Fault dialog
box. This can occur if the thread faults or if the user presses
CTRL+ALT+DEL.
<li>Windows 2000/XP: The user presses CTRL+ALT+DEL or the system invokes the
Hard System Error modal message box (for example, when a program faults or a
device fails).


William Heimbigner
icxcnika at hotpop.com
Visit the UBoard - Forceful Signups Removed! -
http://uboard.proboards32.com - Threaded discussion, improved searching,
human moderating, graphical smileys, better formatting abilities (now what
else was there...)
Visit my website: http://www.geocities.com/icxcnika123

new topic     » topic index » view message » categorize

2. Re: Cool WinAPI procedure, check it out!

William Heimbigner wrote:
> 
> The blockInput procedure blocks keyboard and mouse input events from
> reaching applications.

And why is this a useful thing to do?

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

3. Re: Cool WinAPI procedure, check it out!

William Heimbigner wrote:
> 
> The blockInput procedure blocks keyboard and mouse input events from
> reaching applications.

Why bother to code this function into our apps when Windows does 
this automatically at least once or twice a day?

Irv

new topic     » goto parent     » topic index » view message » categorize

4. Re: Cool WinAPI procedure, check it out!

Irv Mullins wrote:

> William Heimbigner wrote:
>>
>> The blockInput procedure blocks keyboard and mouse input events from
>> reaching applications.
>
> Why bother to code this function into our apps when Windows does
> this automatically at least once or twice a day?

*ROTFL*

Irv, got you there! It seems that you admit, that Windows sometimes does
something, that Linux doesn't do. smile

Regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  Money is the root of all evil.
 \ /  against HTML in       |  Send 20 Dollars for more info.
  X   e-mail and news,      |
 / \  and unneeded MIME     |  http://home.arcor.de/luethje/prog/

new topic     » goto parent     » topic index » view message » categorize

5. Re: Cool WinAPI procedure, check it out!

----- Original Message -----
From: "Juergen Luethje" <j.lue at gmx.de>
To: <EUforum at topica.com>
Sent: Tuesday, September 14, 2004 9:25 AM
Subject: Re: Cool WinAPI procedure, check it out!


>
>
> Irv Mullins wrote:
>
> > William Heimbigner wrote:
> >>
> >> The blockInput procedure blocks keyboard and mouse input events from
> >> reaching applications.
> >
> > Why bother to code this function into our apps when Windows does
> > this automatically at least once or twice a day?
>
> *ROTFL*
>
Yah, me 2. Quite right infact.
The point of this is if you have a critical operation, you can lock the
mouse to prevent some problems. Besides: you shouldn't ask me that question.
Ask microsoft for the point of this function.
...
I bet $1 microbucks they will answer: to allow applications to temporarily
block input.
William Heimbigner
icxcnika at hotpop.com
Visit the UBoard - Forceful Signups Removed! -
http://uboard.proboards32.com - Threaded discussion, improved searching,
human moderating, graphical smileys, better formatting abilities (now what
else was there...)
Visit my website: http://www.geocities.com/icxcnika123

new topic     » goto parent     » topic index » view message » categorize

6. Re: Cool WinAPI procedure, check it out!

William Heimbigner wrote:

> Yah, me 2. Quite right infact.
> The point of this is if you have a critical operation, you can lock the
> mouse to prevent some problems. Besides: you shouldn't ask me that question.
> Ask microsoft for the point of this function.
> ...
> I bet $1 microbucks they will answer: to allow applications to temporarily
> block input.

Maybe it's useful so Windows doesn't have to handle interrupts from the 
mouse/keyboard while doing something else.

Irv

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu