comctl32/tests: Fix some problems revealed by compilation in 64-bit mode.

This commit is contained in:
Dmitry Timoshkov 2007-05-24 17:14:31 +09:00 committed by Alexandre Julliard
parent 2d83063288
commit 6055d04f07
8 changed files with 45 additions and 52 deletions

View File

@ -137,7 +137,7 @@ struct subclass_info
static LRESULT WINAPI datetime_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -182,9 +182,9 @@ static HWND create_datetime_control(DWORD style, DWORD exstyle)
return NULL;
}
info->oldproc = (WNDPROC)SetWindowLongA(hWndDateTime, GWL_WNDPROC,
(LONG)datetime_subclass_proc);
SetWindowLongA(hWndDateTime, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(hWndDateTime, GWLP_WNDPROC,
(LONG_PTR)datetime_subclass_proc);
SetWindowLongPtrA(hWndDateTime, GWLP_USERDATA, (LONG_PTR)info);
return hWndDateTime;
}

View File

@ -402,7 +402,7 @@ struct subclass_info
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -533,9 +533,9 @@ static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
SetWindowPos(childHandle, winpos.hwndInsertAfter, winpos.x, winpos.y,
winpos.cx, winpos.cy, 0);
info->oldproc = (WNDPROC)SetWindowLongA(childHandle, GWL_WNDPROC,
(LONG)header_subclass_proc);
SetWindowLongA(childHandle, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(childHandle, GWLP_WNDPROC,
(LONG_PTR)header_subclass_proc);
SetWindowLongPtrA(childHandle, GWLP_USERDATA, (LONG_PTR)info);
return childHandle;
}

View File

@ -212,7 +212,7 @@ static HWND create_parent_window(void)
static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -256,9 +256,9 @@ static HWND create_listview_control(void)
return NULL;
}
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC,
(LONG)listview_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG_PTR)listview_subclass_proc);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd;
}
@ -286,16 +286,16 @@ static HWND create_custom_listview_control(DWORD style)
return NULL;
}
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC,
(LONG)listview_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG_PTR)listview_subclass_proc);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd;
}
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -326,9 +326,9 @@ static HWND subclass_header(HWND hwndListview)
return NULL;
hwnd = ListView_GetHeader(hwndListview);
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC,
(LONG)header_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG_PTR)header_subclass_proc);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd;
}
@ -773,13 +773,13 @@ static void test_customdraw(void)
insert_column(hwnd, 1);
insert_item(hwnd, 0);
oldwndproc = (WNDPROC)SetWindowLongPtr(hwndparent, GWL_WNDPROC,
(INT_PTR)cd_wndproc);
oldwndproc = (WNDPROC)SetWindowLongPtr(hwndparent, GWLP_WNDPROC,
(LONG_PTR)cd_wndproc);
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
SetWindowLongPtr(hwndparent, GWL_WNDPROC, (INT_PTR)oldwndproc);
SetWindowLongPtr(hwndparent, GWLP_WNDPROC, (LONG_PTR)oldwndproc);
DestroyWindow(hwnd);
}

View File

@ -441,7 +441,7 @@ static HWND create_parent_window(void)
static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -487,9 +487,9 @@ static HWND create_monthcal_control(DWORD style, HWND parent_window)
return NULL;
}
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC,
(LONG)monthcal_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG_PTR)monthcal_subclass_proc);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd;
}

View File

@ -343,7 +343,7 @@ struct subclass_info
static LRESULT WINAPI tabSubclassProcess(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -397,8 +397,8 @@ static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT
assert(tabHandle);
info->oldproc = (WNDPROC)SetWindowLongA(tabHandle, GWL_WNDPROC, (LONG)tabSubclassProcess);
SetWindowLongA(tabHandle, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(tabHandle, GWLP_WNDPROC, (LONG_PTR)tabSubclassProcess);
SetWindowLongPtrA(tabHandle, GWLP_USERDATA, (LONG_PTR)info);
tcNewTab.mask = mask;

View File

@ -445,7 +445,7 @@ static HWND create_parent_window(void){
}
static LRESULT WINAPI trackbar_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
struct subclass_info *info = (struct subclass_info *) GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *) GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -485,9 +485,9 @@ static HWND create_trackbar(DWORD style, HWND parent){
return NULL;
}
info->oldproc = (WNDPROC)SetWindowLongA(hWndTrack, GWL_WNDPROC, (LONG)trackbar_subclass_proc);
info->oldproc = (WNDPROC)SetWindowLongPtrA(hWndTrack, GWLP_WNDPROC, (LONG_PTR)trackbar_subclass_proc);
SetWindowLongA(hWndTrack, GWL_USERDATA, (LONG)info);
SetWindowLongPtrA(hWndTrack, GWLP_USERDATA, (LONG_PTR)info);
return hWndTrack;
}

View File

@ -574,7 +574,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
WNDPROC *lpOldProc = (WNDPROC*)GetWindowLongA(hwnd, GWL_USERDATA);
WNDPROC lpOldProc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
msg.message = message;
msg.flags = sent|wparam|lparam;
@ -584,7 +584,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
add_message(MsgSequences, LISTVIEW_SEQ_INDEX, &msg);
defwndproc_counter++;
ret = CallWindowProcA(*lpOldProc, hwnd, message, wParam, lParam);
ret = CallWindowProcA(lpOldProc, hwnd, message, wParam, lParam);
defwndproc_counter--;
return ret;
@ -592,7 +592,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WNDPROC *pOldWndProc;
WNDPROC pOldWndProc;
switch(msg) {
@ -604,16 +604,9 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
SetFocus(hTree);
pOldWndProc = HeapAlloc(GetProcessHeap(), 0, sizeof(WNDPROC));
if ( !ok(pOldWndProc != NULL, "Failed to allocate memory for subclass_info.\n") )
{
PostQuitMessage(1);
break;
}
/* Record the old WNDPROC so we can call it after recording the messages */
*pOldWndProc = (WNDPROC)SetWindowLongA(hTree, GWL_WNDPROC, (LONG)TreeviewWndProc);
SetWindowLongA(hTree, GWL_USERDATA, (LONG)pOldWndProc);
pOldWndProc = (WNDPROC)SetWindowLongPtrA(hTree, GWLP_WNDPROC, (LONG_PTR)TreeviewWndProc);
SetWindowLongPtrA(hTree, GWLP_USERDATA, (LONG_PTR)pOldWndProc);
return 0;
}

View File

@ -259,7 +259,7 @@ struct subclass_info
static LRESULT WINAPI edit_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -298,16 +298,16 @@ static HWND create_edit_control(void)
return NULL;
}
info->oldproc = (WNDPROC)SetWindowLongA(edit, GWL_WNDPROC,
(LONG)edit_subclass_proc);
SetWindowLongA(edit, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(edit, GWLP_WNDPROC,
(LONG_PTR)edit_subclass_proc);
SetWindowLongPtrA(edit, GWLP_USERDATA, (LONG_PTR)info);
return edit;
}
static LRESULT WINAPI updown_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA);
struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0;
LRESULT ret;
struct message msg;
@ -348,9 +348,9 @@ static HWND create_updown_control(void)
return NULL;
}
info->oldproc = (WNDPROC)SetWindowLongA(updown, GWL_WNDPROC,
(LONG)updown_subclass_proc);
SetWindowLongA(updown, GWL_USERDATA, (LONG)info);
info->oldproc = (WNDPROC)SetWindowLongPtrA(updown, GWLP_WNDPROC,
(LONG_PTR)updown_subclass_proc);
SetWindowLongPtrA(updown, GWLP_USERDATA, (LONG_PTR)info);
return updown;
}