标题:windows 窗口小问
取消只看楼主
T_MACC
Rank: 4
等 级:业余侠客
威 望:8
帖 子:99
专家分:211
注 册:2015-4-14
结帖率:83.33%
已结贴  问题点数:20 回复次数:0 
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   可是要加那个呢    好无解
搜索更多相关主题的帖子: windows return include 
2015-07-07 17:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-455165-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.473048 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved