windows 窗口小问
#include "resource.h"#include "windows.h"
HHOOK hHook = NULL;
LRESULT CALLBACK HookProc(int code, WPARAM wparm, LPARAM lparam);
//窗口过程
int CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wparm, LPARAM lparam);
//主函数
int APIENTRY WinMain(__in HINSTANCE hinstance,__in_opt HINSTANCE hPrevInstance,__in_opt LPSTR lpCmdLine,__in int nShowCmd)
{
return
DialogBox(hinstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
}
// 窗口过程处理函数
int CALLBACK DlgProc(HWND hDlog, UINT uMsg, WPARAM wParam, LPARAM lparam)
{
switch (uMsg)
{
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDCANCEL:
{
UnhookWindowsHookEx(hHook);
EndDialog(hDlog,wParam);
}
break;
case IDOK:
{
hHook = SetWindowsHookEx(WH_JOURNALRECORD, HookProc, GetDriverModuleHandle(NULL), 0);
}
break;
}
}
break;
case WM_CLOSE:
{
EndDialog(hDlog,0);
}
break;
}
return 0;
}
//鼠标钩子过程
LRESULT CALLBACK HookProc(int code, WPARAM wparm, LPARAM lparam)
{
HWND hwnd;
POINT point;
//获得鼠标位置
GetCursorPos(&point);
//得到鼠标句柄
hwnd = WindowFromPoint(point);
//窗口风格
long nstyle = GetWindowLong(hwnd,GWL_STYLE);
EVENTMSG *event = (EVENTMSG *)lparam;
//是否为密码左键
if (event->message == WM_LBUTTONDOWN)
{
//是否为密码框
if (nstyle&ES_PASSWORD)
{
PostMessage(hwnd,EM_SETPASSWORDCHAR,0,0);
}
}
return CallNextHookEx(hHook,code,wparm,lparam);
}
出现这个问题 我该怎麽解决呢
该符号在函数 "int __stdcall DlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DlgProc@@YGHPAUHWND__@@IIJ@Z) 中被引用
1>F:\编程\c++\新建文件夹\kongjian\Debug\kongjian.exe : fatal error LNK1120: 1 个无法解析的外部命令
百度的解决办法说加lib 可是要加那个呢 好无解