From: Zhaoyi zhaoyi@uniontech.com
Signed-off-by: Zhaoyi zhaoyi@uniontech.com --- dlls/comctl32/tests/syslink.c | 43 +++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index d5192c26b5c..5acae2aee91 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -30,6 +30,7 @@ #define SYSLINK_SEQ_INDEX 1
static HWND hWndParent; +static int g_linkid;
static struct msg_sequence *sequences[NUM_MSG_SEQUENCE];
@@ -100,7 +101,24 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP }
defwndproc_counter++; - ret = DefWindowProcW(hwnd, message, wParam, lParam); + switch(message) + { + case WM_NOTIFY: + { + NMLINK *nml = ((NMLINK*)lParam); + if (nml && NM_CLICK == nml->hdr.code) + { + g_linkid = nml->item.iLink ; + } + + /* Return zero to indicate default processing */ + ret = 0; + break; + } + + default: + ret = DefWindowProcW(hwnd, message, wParam, lParam); + } defwndproc_counter--;
return ret; @@ -162,7 +180,7 @@ static HWND create_syslink(DWORD style, HWND parent) HWND hWndSysLink;
/* Only Unicode will do here */ - hWndSysLink = CreateWindowExW(0, WC_LINK, L"Head <a href="link1">Name1</a> Middle <a href="link2">Name2</a> Tail", + hWndSysLink = CreateWindowExW(0, WC_LINK, L"Head <a href="link1">Name1</a> Middle <a href="link2">Name2</a> Middle <a href="link3">Name3</a> Tail", style, 0, 0, 150, 50, parent, NULL, GetModuleHandleW(NULL), NULL); if (!hWndSysLink) return NULL; @@ -238,6 +256,26 @@ static void test_LM_GETIDEALSIZE(void) DestroyWindow(hwnd); }
+static void test_GETSYSLINKID(void) +{ + HWND hwnd; + int point; + + hwnd = create_syslink(WS_CHILD | WS_TABSTOP | WS_VISIBLE, hWndParent); + ok(hwnd != NULL, "Failed to create SysLink window.\n"); + + /*the test point of link3(x=120 y=20).*/ + point = ((20 << 16) | 120); + + SendMessageA(hwnd, WM_LBUTTONDOWN, 1, (LPARAM)point); + + g_linkid = 0; + SendMessageA(hwnd, WM_LBUTTONUP, 0, (LPARAM)point); + todo_wine ok(g_linkid == 2, "GETSYSLINKID was not processed correctly!\n"); + + DestroyWindow(hwnd); +} + START_TEST(syslink) { ULONG_PTR ctx_cookie; @@ -266,6 +304,7 @@ START_TEST(syslink) test_create_syslink(); test_LM_GETIDEALHEIGHT(); test_LM_GETIDEALSIZE(); + test_GETSYSLINKID();
DestroyWindow(hWndParent); unload_v6_module(ctx_cookie, hCtx);