1

ヒア・ゴーズ・マイ・コード

// hook.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <iostream>

using namespace std;

LRESULT CALLBACK GetMsgProc(int code, WPARAM wParam, LPARAM lParam);

int _tmain(int argc, _TCHAR* argv[]){
int __;
cout << "Hallo World" << endl;
SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, 0, 0);
cin >> __;
return 0;
}

LRESULT CALLBACK GetMsgProc(int code, WPARAM wParam, LPARAM lParam){
cout << code << endl;
return 0;
}

WM_PAINT イベントを取得しようとしています... 現時点では、すべてのイベントをトラップしようとしています。どこに行方不明ですか?

4

1 に答える 1

-1

ドキュメントを読んでください。特に最後の2つのパラメーターに関して、使用法が正しくない理由を明確に示しています。すべてのスレッドをフックする場合は、モジュールを提供する必要があります http://msdn.microsoft.com/en-us/library/ms644990(v=vs.85).aspx

于 2011-03-25T12:52:50.517 に答える