Bonjour,
Je cherche à récupérer le handle de la fenêtre mère à partir de ma fenêtre fille, en C.
Merci.
Bonjour,
Je cherche à récupérer le handle de la fenêtre mère à partir de ma fenêtre fille, en C.
Merci.
Avec la fonction GetParent :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 The GetParent function retrieves the handle of the specified child window's parent window. HWND GetParent( HWND hWnd // handle of child window );
une fenêtre peut-elle ne pas avoir de parent ??? Parce que la fonction GetParent ne me retourne rien comme nom de handle.
Mother=GetParent(hwndDlg);
GetWindowText(Mother, szFileName, MAX_PATH);
MessageBox(hwndDlg, szFileName, "Nom cherché :", MB_OK);
Au pire Mother doit être égal à GetDesktopWindow :
Pour les détails voir les tutoriels et cours de formation pour apprendre la programmation en langage C : http://c.developpez.com/cours/
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 The GetDesktopWindow function returns the handle of the Windows desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which all icons and other windows are painted. HWND GetDesktopWindow(VOID)
Partager