Author: mjmartin Date: Mon Oct 12 11:50:57 2009 New Revision: 43392
URL: http://svn.reactos.org/svn/reactos?rev=43392&view=rev Log: GetDlgItem: Change to WINE's implementation as ours was incorrect. Remove function GetDlgItemEnumProc and struct GETDLGITEMINFO as they are no longer needed. Fixes drawing issues in Open and Save dialogs for OpenOffice.
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/di... ============================================================================== --- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Mon Oct 12 11:50:57 2009 @@ -103,13 +103,6 @@ LPCWSTR faceName; BOOL dialogEx; } DLG_TEMPLATE; - -/* GetDlgItem structure */ -typedef struct -{ - INT nIDDlgItem; - HWND control; -} GETDLGITEMINFO;
/* CheckRadioButton structure */ typedef struct @@ -1461,22 +1454,6 @@ return ret; }
-/*********************************************************************** - * GetDlgItemEnumProc - * - * Callback for GetDlgItem - */ -BOOL CALLBACK GetDlgItemEnumProc (HWND hwnd, LPARAM lParam ) -{ - GETDLGITEMINFO * info = (GETDLGITEMINFO *)lParam; - if(info->nIDDlgItem == GetWindowLongPtrW( hwnd, GWL_ID )) - { - info->control = hwnd; - return FALSE; - } - return TRUE; -} -
/* FUNCTIONS *****************************************************************/
@@ -2029,13 +2006,16 @@ HWND hDlg, int nIDDlgItem) { - GETDLGITEMINFO info; - info.nIDDlgItem = nIDDlgItem; - info.control = 0; - if(hDlg && !EnumChildWindows(hDlg, (WNDENUMPROC)&GetDlgItemEnumProc, (LPARAM)&info)) - return info.control; - else - return 0; + int i; + HWND *list = WIN_ListChildren(hDlg); + HWND ret = 0; + + if (!list) return 0; + + for (i = 0; list[i]; i++) if (GetWindowLongPtrW(list[i], GWLP_ID) == nIDDlgItem) break; + ret = list[i]; + HeapFree(GetProcessHeap(), 0, list); + return ret; }