1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
   | void __fastcall TMonThread::Execute()
{
            //---- Placer le code du thread ici ----
char sz[256];
HWND hwnd, hwnd1, hwnd2;
    do
    {
    hwnd = FindWindow("#32770","Enregistrer le fichier PDF sous");
// hwnd1 = FindWindowEx(hwnd, NULL, "DUIViewWndClassName", NULL);
    GetWindowText(hwnd, sz, 256);
    }
    while(strcmp(sz, "Enregistrer le fichier PDF sous"));
 
    do
    {
    // on recupere le Handle du Button Enregistrer
    hwnd2 = FindWindowEx(hwnd, NULL, "Button", "&Enregistrer");
    GetWindowText(hwnd2, sz, 256);
    }
    while(strcmp(sz, "&Enregistrer"));
 // on simule l'appuie de la touche entrée
 PostMessage(hwnd2,WM_KEYDOWN,VK_RETURN,0);
 PostMessage(hwnd2,WM_KEYUP,VK_RETURN,0);
 
    delete MonThread;
}
//----- | 
Partager