首页
社区
课程
招聘
[求助]CallWindowProc
发表于: 2008-1-31 08:39 4570

[求助]CallWindowProc

2008-1-31 08:39
4570
各位大侠,我想跟踪一个软件,看到我点击菜单后的对应响应函数,我在callWindowProc函数上设了条件断点 MSG==WM_COMMAND,是可以跟到点击菜单的消息。但是,CallWindowProc函数的参数已经不是MSG结构了,请问,怎么可以找到这个菜单点击消息对应的处理函数啊

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 846
活跃值: (221)
能力值: (RANK:570 )
在线值:
发帖
回帖
粉丝
2
The CallWindowProc function passes message information to the specified window procedure.

Syntax

LRESULT CallWindowProc(          WNDPROC lpPrevWndFunc,
    HWND hWnd,
    UINT Msg,
    WPARAM wParam,
    LPARAM lParam
);
Parameters

lpPrevWndFunc
[in] Pointer to the previous window procedure. If this value is obtained by calling the GetWindowLong function with the nIndex parameter set to GWL_WNDPROC or DWL_DLGPROC, it is actually either the address of a window or dialog box procedure, or a special internal value meaningful only to CallWindowProc.
hWnd
[in] Handle to the window procedure to receive the message.
Msg
[in] Specifies the message.
wParam
[in] Specifies additional message-specific information. The contents of this parameter depend on the value of the Msg parameter.
lParam
[in] Specifies additional message-specific information. The contents of this parameter depend on the value of the Msg parameter.
Return Value

The return value specifies the result of the message processing and depends on the message sent.

Remarks

Use the CallWindowProc function for window subclassing. Usually, all windows with the same class share one window procedure. A subclass is a window or set of windows with the same class whose messages are intercepted and processed by another window procedure (or procedures) before being passed to the window procedure of the class.

The SetWindowLong function creates the subclass by changing the window procedure associated with a particular window, causing the system to call the new window procedure instead of the previous one. An application must pass any messages not processed by the new window procedure to the previous window procedure by calling CallWindowProc. This allows the application to create a chain of window procedures.

If STRICT is defined, the lpPrevWndFunc parameter has the data type WNDPROC. The WNDPROC type is declared as follows:

LRESULT (CALLBACK* WNDPROC) (HWND, UINT, WPARAM, LPARAM);

If STRICT is not defined, the lpPrevWndFunc parameter has the data type FARPROC. The FARPROC type is declared as follows:

int (FAR WINAPI * FARPROC) ()

In C, the FARPROC declaration indicates a callback function that has an unspecified parameter list. In C++, however, the empty parameter list in the declaration indicates that a function has no parameters. This subtle distinction can break careless code. Following is one way to handle this situation:

#ifdef STRICT
  WNDPROC MyWindowProcedure
#else
  FARPROC MyWindowProcedure
#endif
...
  lResult = CallWindowProc(MyWindowProcedure, ...) ;

For further information about functions declared with empty argument lists, refer to The C++ Programming Language, Second Edition, by Bjarne Stroustrup.

Windows NT/2000/XP: The CallWindowProc function handles Unicode-to-ANSI conversion. You cannot take advantage of this conversion if you call the window procedure directly.

Windows 95/98/Me: CallWindowProcW is supported by the Microsoft Layer for Unicode (MSLU). Also, the ANSI version is supported, to provide more consistent behavior across all Microsoft Windows operating systems. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
2008-1-31 09:25
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
这位仁兄说的,我都知道啊
我是说,怎么才能由这个函数跟踪到msg结构体里面的函数地址啊
2008-2-1 08:28
0
雪    币: 846
活跃值: (221)
能力值: (RANK:570 )
在线值:
发帖
回帖
粉丝
4
lpPrevWndFunc
[in] Pointer to the previous window procedure. If this value is obtained by calling the GetWindowLong function with the nIndex parameter set to GWL_WNDPROC or DWL_DLGPROC, it is actually either the address of a window or dialog box procedure, or a special internal value meaningful only to CallWindowProc.
2008-2-1 09:16
0
游客
登录 | 注册 方可回帖
返回
//