|
-
April 18th, 2012, 03:57 PM
#1
[RESOLVED] Trying to close a bubble window that pops up from a tray icon
I am configuring the windows supplicant for 802.1x. While doing so, it pops up a bubble notification from a tray icon that says something like "Click to provide additional information..." I wish to suppress this so I do not get this bubble notification. I figured I could enumerate through all the windows and send that window a WM_CLOSE.
Anyway if I enumerate through child windows of the desktop I never see this window (code follows). However if I use a dev studio 2008 tool, spy and I use the find window and drag the cursor thing over the window, it finds it.
So what am I doing wrong and/or is there a better way to go about doing this.
Code:
#define SEARCH_TEXT_XP2000 "Click here to enter your user name and password for the network"
#define SEARCH_TEXT_VISTA "Click to provide additional information and connect"
//#define SEARCH_TEXT_VISTA "additional information"
// Size of the smaller of the above strings
#define SEARCH_TEXT_LEN sizeof(SEARCH_TEXT_VISTA)
// Window Clicker section. There are some windows
BOOL CALLBACK EnumFunc(HWND hwnd, LPARAM lParam)
{
int Len;
char Buffer[1025];
bool *DidClick = (bool *)lParam;
Buffer[0] = 0;
Len = (int)SendMessage(hwnd, WM_GETTEXT, 1024, (LPARAM)Buffer);
if (Len >= SEARCH_TEXT_LEN)
{
CString MatchBuff;
MatchBuff = Buffer;
printf("%s\n", MatchBuff.GetString() );
if ( (-1 != MatchBuff.Find(SEARCH_TEXT_XP2000)) || (-1 != MatchBuff.Find(SEARCH_TEXT_VISTA)) )
{
SendMessage(hwnd, WM_CLOSE , NULL, NULL);
// SendMessage(hwnd, WM_LBUTTONUP , NULL, NULL);
*DidClick = true;
return FALSE;
}
}
return TRUE;
}
void WaitForClick(void)
{
bool DidClick = false;
while ( false == DidClick)
{
printf(" ------------ \n");
EnumChildWindows(GetDesktopWindow(), EnumFunc, (LPARAM)&DidClick);
Sleep(500);
printf(" ------- \n");
}
}
I also printed out the windows to the console and verified that I do not see that window anywhere.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|