Let me just first mention that you can actually use the keyboard/keystrokes to close the alert windows NOW. You just have to set the input focus to the alert window using FindWindow()/SetForegroundWindow(), then send it a few TAB keys, and a SPACE key. The alerts do not come up with the input focus on them (to prevent you from actually dismissing them by accident), and you have to click them with the mouse before you can tab around in them and dismiss them with the keyboard.
The problem right now is that you can’t even ALT+TAB over to the alerts, and even if you could, it takes a convoluted TAB/SHIFT+TAB and then SPACE to get the focus to the OK button and press it (with SPACE).
What we need for advanced users is keyboard short cuts that can be turned on, and when they’re turned on, make a way to get the alert window to have the input focus, and let the user clear them with defined accelerator keys.
As for your argument that mouse is buggy and keyboard would open up big hole in security, let me calm your fears and assure you that either mouse or keyboard are equally easy to implement for your most ignorant, snot-nosed script kiddie hacker-wanna-be (and any actual programmers with malicious intent).
And, programs can send keys to the alerts to clear them RIGHT NOW. Users just can’t use the keyboard to clear them. Quite a paradox, eh?
Using Mouse Events
Using mouse events, a hack program will have to use FindWindow() to find the OK button, and send that individual window (button class) events. I know, I have a program that does that. As I mentioned in my original message on this thread:
On the Comodo FW alerts, run SPY++ from Windows Platform SDK or .NET tools, and you will see that the alert is just a standard "#32770 (Dialog)" class dialog, and all the controls inside it are just standard windows which are children of it. The "OK" button is just a standard button of class "Button" with a text caption "OK". You could easily write a VBA script that would change the text or click that button every time it shows up. Yes, I've done that from VBA, VB, C, C++, C# and Python.
The following assertion is absolutely FALSE and ignorant:
the mouse approach is a buggy one, since it needs to somehow monitor when a popup comes, and click and if by accident somehow comodo popups, popup behind something (you run a full screen application) then the click will miss, or will keep trying to click making the user suspicious."
The window can be found with a simple FindWindow() on a timer watching for it (there are other controls on the dialog that can be used to tell it’s the alert dialog") to get the window handle of the OK button to which to send mouse messages.
FURTHER, sending mouse click messages to a button does NOT move the visible mouse cursor on the screen.
Using Key Events
As for using key events, if accelerators (shortcuts) were implemented, a hack program will have to use FindWindow() to find the OK button, give it’s parent focus with SetForegroundWindow(), then send the accelerator key combinations to that window (the “#32770 (Dialog)” class window that the alert is) using messages or SendInput(). It could do similar things, as I mentioned above, with sending TAB and SPACE to the window today.
Either way, piece of cake. Mouse is actually easier… and you don’t need to know where the window is, the screen resolution or anything, you just need to find “#32770 (Dialog)”, then find it’s child, “button” class windows, find the one that is “ok”.
There are actually ways to prevent a program from being tricked by either programmatic mouse OR keyboard input. Let’s hope that Comodo adds keyboard shortcuts and those defense measures. Today, PROGRAMS can already automate the alerts with mouse AND keyboard, but you and I can’t use the keyboard to clear them ourselves.
A silly, annoying, perplexing paradox.