a simple c++ application to instantly click the annoying network message (banner) window of cisco vpn client away. tastes best with some form of auto-initiation. (file size: 10KB, mem size: 100KB (x86))...
I needed this desperately for getting rid of the annoyance of having to be present at my computer to confirm that I read the university network message (mainly a reminder of proper conduct) each time the cisco vpn client reconnected. I range-tested the window messages to find out the one that triggered a button click and two messages 513 & 514 sent consequently did the trick!
I love the possibilities programming offers.
[Tested to comply with Cisco Systems VPN Client 4.7.00.0533]
****************
#include "stdafx.h"
#include <windows.h>
const LPCWSTR BannerWindowText = L"VPN Client | Banner";
extern HWND BannerWindow = 0;
extern HWND OkButton = 0;
int main()
{
while (true)
{
BannerWindow = FindWindow(NULL, BannerWindowText);
if (BannerWindow > 0)
{
OkButton = FindWindowEx(BannerWindow, 0, NULL, NULL);
if (OkButton > 0)
{
SendMessage(OkButton, 513, 0, 0);
SendMessage(OkButton, 514, 0, 0);
}
}
Sleep(5);
}
return 0;
}