tags:

views:

56

answers:

1

Possible Duplicates:
how to Make the Mouse Freeze c#
How can I block keyboard and mouse input in C#?

I'm making a mouse macro program, and I already have the core mostly worked out. It would be nice, though, if I could temporarily block the user from using the mouse while the macro is playing... is this possible in C#?


EDIT

This code works perfectly for me:

    [DllImport("user32.dll")]
    private static extern bool BlockInput(bool block);

    public static void FreezeMouse()
    {
        BlockInput(true);
    }

    public static void ThawMouse()
    {
        BlockInput(false);
    }
+1  A: 

Block input in C# (stackoverflow.com)

mootinator