在里面
this Microsoft example
关于如何处理SysLink控件的WM_NOTIFY消息,他们有以下代码,
g_hLink
作为SysLink控件的句柄:
// g_hLink is the handle of the SysLink control.
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
case NM_CLICK: // Fall through to the next case.
case NM_RETURN:
{
PNMLINK pNMLink = (PNMLINK)lParam;
LITEM item = pNMLink->item;
if ((((LPNMHDR)lParam)->hwndFrom == g_hLink) && (item.iLink == 0))
{
ShellExecute(NULL, L"open", item.szUrl, NULL, NULL, SW_SHOW);
}
else if (wcscmp(item.szID, L"idInfo") == 0)
{
MessageBox(hDlg, L"This isn't much help.", L"Example", MB_OK);
}
break;
}
}
break;
我不明白为什么
(((LPNMHDR)lParam)->hwndFrom == g_hLink)
else子句不需要条件吗?
或者这只是示例中的一个错误?