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.

svn path=/trunk/; revision=43392
This commit is contained in:
Michael Martin
2009-10-12 09:50:57 +00:00
parent 978aff9a6e
commit 25a93ac224
+10 -30
View File
@@ -104,13 +104,6 @@ typedef struct
BOOL dialogEx;
} DLG_TEMPLATE;
/* GetDlgItem structure */
typedef struct
{
INT nIDDlgItem;
HWND control;
} GETDLGITEMINFO;
/* CheckRadioButton structure */
typedef struct
{
@@ -1461,22 +1454,6 @@ static BOOL DIALOG_DlgDirSelect( HWND hwnd, LPWSTR str, INT len,
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 @@ GetDlgItem(
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;
}