Thanks for your reply.
But the link provided by you is not helpful for me.
On button click i am generating a word file at the same time i am editing the word file means add header ,footer, page size using the sendkeys at that time i want to stop user to enter any key from keyboard or mouse action. After process completed it will activate again.
Here is code that i am trying but its not working..
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Public Shared Sub DisableInput(ByVal makeDisabled As Boolean)
Dim n As Boolean = BlockInput(makeDisabled)
by bhagawatshinde: n/a
Try this. It works on my end.
Public Shared Function BlockInput(ByVal block As Boolean) As Boolean
dim blocked as boolean = BlockInput(True)