English 中文(简体)
我如何安全地从DLL的电泵中看到?
原标题:How do I safely hook into the message pump from a DLL?
  • 时间:2011-09-30 08:49:13
  •  标签:
  • c++
  • windows

我试图从装上我的DLLL的进程中获取信息。

我尝试:

SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC)WndProc, hInstance, 0);

这使我对“由于你的系统遗漏了Y.dll,无法启动Program X”的误解。 这就是我在标题中“安全”的原因。

我还尝试:

SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC)WndProc, hInstance, threadId);

Where threadId is the result of GetCurrentThreadId() in my DLLMain. This one works, but I don t get any messages for the window (just a bunch of 512 and 1025).

最佳回答

电文与透镜和窗户有关,电离层电离层电离层电离层电离层电离层电流可能由电离层电流负荷。 因此没有直接通信。

而另一方面,ook要么是全球性的,要么是永久的。

所有这一切都意味着,你必须选择,你是否只想从特定深层或全球(在具体桌面的所有过程中,所有镜子)传递信息,然后才能过滤你感兴趣的过程。

Your second code snippet is a thread hook. The first one is the global hook where you definitely do something wrong as successful hook itself does not cause error messages you mentioned.

问题回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签