Réponse acceptée !
salut,
bon ben alors voilà comment il faut procéder : - obtenir le handle du tray : (à noter que ca peut ne pas marcher pour les versions suivantes de Windows...
//renvoie le Hwnd du tray HWND GethWndTray() { HWND hwnd=NULL,hwnd2=NULL; //handle //on descend dans la hiérarchie parent-enfant hwnd = FindWindow("Shell_TrayWnd", NULL); hwnd = FindWindowEx(hwnd, NULL, "TrayNotifyWnd", NULL); hwnd2 = FindWindowEx(hwnd, NULL, "SysPager", NULL); //uniquement XP if (hwnd2==NULL) // ME,2000 hwnd2=hwnd; //jusqu//à obtenir le handle de la barre d//outils faisant de tray hwnd2 = FindWindowEx(hwnd2, NULL, "ToolbarWindow32", NULL);// ME, 2000, XP... if (hwnd2 == NULL) return hwnd; // 95,98 else return hwnd2; // ME, 2000, XP... }
ensuite : GetWindowRect(hwndtray,&rect) et GetDC(NULL) et GetPixel(hDC,rect.left,rect.top)...
ShareVB
|