| 1200 | |
| 1201 | |
| 1202 | BOOL CALLBACK EnumDialog(HWND aWnd, LPARAM lParam) |
| 1203 | // lParam should be a pointer to a ProcessId (ProcessIds are always non-zero?) |
| 1204 | // To continue enumeration, the function must return TRUE; to stop enumeration, it must return FALSE. |
| 1205 | { |
| 1206 | pid_and_hwnd_type &pah = *(pid_and_hwnd_type *)lParam; // For performance and convenience. |
| 1207 | if (!lParam || !pah.pid) return FALSE; |
| 1208 | DWORD pid; |
| 1209 | GetWindowThreadProcessId(aWnd, &pid); |
| 1210 | if (pid == pah.pid) |
| 1211 | { |
| 1212 | TCHAR buf[32]; |
| 1213 | GetClassName(aWnd, buf, _countof(buf)); |
| 1214 | // This is the class name for windows created via MessageBox(), GetOpenFileName(), and probably |
| 1215 | // other things that use modal dialogs: |
| 1216 | if (!_tcscmp(buf, _T("#32770"))) |
| 1217 | { |
| 1218 | pah.hwnd = aWnd; // An output value for the caller. |
| 1219 | return FALSE; // We're done. |
| 1220 | } |
| 1221 | } |
| 1222 | return TRUE; // Keep searching. |
| 1223 | } |
| 1224 | |
| 1225 | |
| 1226 |
nothing calls this directly
no outgoing calls
no test coverage detected