diff options
Diffstat (limited to 'alf/alfcombobox.cpp')
| -rw-r--r-- | alf/alfcombobox.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/alf/alfcombobox.cpp b/alf/alfcombobox.cpp index a6e846f..409d64f 100644 --- a/alf/alfcombobox.cpp +++ b/alf/alfcombobox.cpp @@ -44,8 +44,7 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SetWindowLongPtr(hwnd, 0, (LONG_PTR)params->app); } - ALFAPP app = (ALFAPP)GetWindowLongPtr(hwnd, 0); - HWND hwndChild = (HWND)GetWindowLongPtr(hwnd, sizeof(void*)); + HWND hwndChild = (HWND)GetWindowLongPtr(hwnd, 0); if (uMsg == WM_CREATE) { ALFComboCreateParams *params = (ALFComboCreateParams*)((CREATESTRUCT*)lParam)->lpCreateParams; @@ -61,7 +60,7 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ((CREATESTRUCT*)lParam)->hInstance, NULL); - SetWindowLongPtr(hwnd, sizeof(void*), (LONG_PTR)hwndCombo); + SetWindowLongPtr(hwnd, 0, (LONG_PTR)hwndCombo); } if (uMsg == WM_ENABLE && hwndChild) { EnableWindow(hwndChild, (BOOL)wParam); @@ -152,7 +151,7 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } if (!ps->cy) { - ps->cy = tm.tmHeight + 2*app->compatFn->GetSystemMetricsForDpi( + ps->cy = tm.tmHeight + 2*ALF_Compat_GetSystemMetricsForDpi( SM_CYEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200)) + 4 /* padding internal to the edit control */ + 2 /* external padding to line up with themed button */; @@ -247,7 +246,7 @@ ALF__ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) DWORD heightOffset = 0; if (LOBYTE(LOWORD(GetVersion())) >= 4) { - heightOffset = - 2*app->compatFn->GetSystemMetricsForDpi( + heightOffset = - 2*ALF_Compat_GetSystemMetricsForDpi( SM_CYEDGE, ALF_CentipointsToPixels(GetParent(hwnd), 7200)) - 4; } else { @@ -274,7 +273,7 @@ ALF_RegisterComboClass(ALFAPP app) ZeroMemory(&cls, sizeof(cls)); TCHAR classNameBuf[256]; - ALF_BuildRandomClassName(app, TEXT("ALFComboBox."), classNameBuf); + ALF_BuildRandomClassName(TEXT("ALFComboBox"), classNameBuf, 256); cls.hInstance = app->hInstance; cls.hCursor = LoadCursor(NULL, (LPTSTR)IDC_ARROW); @@ -285,7 +284,7 @@ ALF_RegisterComboClass(ALFAPP app) cls.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); } cls.lpszClassName = classNameBuf; - cls.cbWndExtra = sizeof(void*)*2; + cls.cbWndExtra = sizeof(void*); cls.lpfnWndProc = ALF__ComboWindowProc; ATOM classatom = RegisterClass(&cls); |
