我试图在我的窗口上放置一个简单的超链接。
INITCOMMONCONTROLSEX iccx;
iccx.dwSize = sizeof(INITCOMMONCONTROLSEX);
iccx.dwICC = ICC_LINK_CLASS; // CommCtrl.h: #define ICC_LINK_CLASS 0x00008000
bool bResult = InitCommonControlsEx(&iccx); // bResult is false.
DWORD dwError = GetLastError(); // dwError is 0.
hWnd = CreateWindowExW( /*_In_ DWORD*/ 0,
/*_In_opt_ LPCTSTR*/ WC_LINK, // CommCtrl.h: #define WC_LINK L"SysLink"
/*_In_opt_ LPCTSTR*/ L"Hello World",
/*_In_ DWORD*/ WS_VISIBLE | WS_CHILD | WS_TABSTOP,
/*_In_ int*/ 50,
/*_In_ int*/ 200,
/*_In_ int*/ 100,
/*_In_ int*/ 20,
/*_In_opt_ HWND*/ hWndParent,
/*_In_opt_ HMENU*/ NULL,
/*_In_opt_ HINSTANCE*/ hInstance,
/*_In_opt_ LPVOID*/ NULL);
DWORD dwError = GetLastError(); // hWnd is NULL and dwError is 1407.
错误代码 1407 在这里解释如下。
ERROR_CANNOT_FIND_WND_CLASS
1407 (0x57F)
Cannot find window class.
我使用的是 Windows 8.1 Pro x64,我从未在任何其他版本的 Windows 上尝试过此代码。
这里有什么问题?