So when a user goes to explorer.exe (documents, pictures, etc.) and hits an item there, my program should intercept that and decide whatever happens.
I'm not totally helpless. I have a solution setup, but I reckon it's really shitty, and there must be a better way using hooking or something.
Anyways, here's my current solution:
I have a very broad WMI query: SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'
This is fed into an event listener, and then an event is fired everytime something fits that query.
Then, I'd close whatever process down that is (considering it's not owned by system or a well known process such as dllhost.exe), and then I'd do whatever I want.
Problem is WMI is horribly CPU expensive, and slow. Which in turn means the user will see their program flash for a second, then close.
Has anyone dealt with this before, and if so, what was your solution?
I'm not totally helpless. I have a solution setup, but I reckon it's really shitty, and there must be a better way using hooking or something.
Anyways, here's my current solution:
I have a very broad WMI query: SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'
This is fed into an event listener, and then an event is fired everytime something fits that query.
Then, I'd close whatever process down that is (considering it's not owned by system or a well known process such as dllhost.exe), and then I'd do whatever I want.
Problem is WMI is horribly CPU expensive, and slow. Which in turn means the user will see their program flash for a second, then close.
Has anyone dealt with this before, and if so, what was your solution?



