Please clarify your situation.
In a normal event-driven application, you don't need to "prevent" the user
from doing anything, you simply don't program a response to a given event
and the event is ignored by your application.
I suspect this is not what you have in mind, so please educate us further.