首页
社区
课程
招聘
[求助]获取文本框内容有几个API函数?
发表于: 2008-8-25 15:25 11731

[求助]获取文本框内容有几个API函数?

2008-8-25 15:25
11731
破解VB6.0开发的一个软件。需用户名及密码登录

获取用户名,密码文本框内容的API函数应为什么?

根据书上动态调试技术里所说的。
我用GetDlgItemTextA,GetDlgItemTextW,GetWindowTextA,GetWindowTextW都断不到

[培训]科锐逆向工程师培训第53期2025年7月8日开班!

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 846
活跃值: (221)
能力值: (RANK:570 )
在线值:
发帖
回帖
粉丝
2
An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller.

Syntax

To send this message, call the SendMessage function as follows.
lResult = SendMessage(      // returns LRESULT in lResult     (HWND) hWndControl,      // handle to destination control     (UINT) WM_GETTEXT,      // message ID     (WPARAM) wParam,      // = (WPARAM) () wParam;    (LPARAM) lParam      // = (LPARAM) () lParam; );   
Parameters

wParam
Specifies the maximum number of TCHARs to be copied, including the terminating null character.
Windows NT/2000/XP:ANSI applications may have the string in the buffer reduced in size (to a minimum of half that of the wParam value) due to conversion from ANSI to Unicode.

lParam
Pointer to the buffer that is to receive the text.
Return Value

The return value is the number of TCHARs copied, not including the terminating null character.

Remarks

The DefWindowProc function copies the text associated with the window into the specified buffer and returns the number of characters copied. Note, for non-text static controls this gives you the text with which the control was originally created, that is, the ID number. However, it gives you the ID of the non-text static control as originally created. That is, if you subsequently used a STM_SETIMAGE to change it the original ID would still be returned.

For an edit control, the text to be copied is the content of the edit control. For a combo box, the text is the content of the edit control (or static-text) portion of the combo box. For a button, the text is the button name. For other windows, the text is the window title. To copy the text of an item in a list box, an application can use the LB_GETTEXT message.

When the WM_GETTEXT message is sent to a static control with the SS_ICON style, a handle to the icon will be returned in the first four bytes of the buffer pointed to by lParam. This is true only if the WM_SETTEXT message has been used to set the icon.

Rich Edit: If the text to be copied exceeds 64K, use either the EM_STREAMOUT or EM_GETSELTEXT message.

Windows 2000/XP: Sending a WM_GETTEXT message to a non-text static control, such as a static bitmap or static icon control, does not return a string value. Instead, it returns zero. In addition, in previous versions of Microsoft Windows and Microsoft Windows NT, applications could send a WM_GETTEXT message to a non-text static control to retrieve the control's ID. To retrieve a control's ID in Windows 2000/XP, applications can use GetWindowLong passing GWL_ID as the index value or GetWindowLongPtr using GWLP_ID.
2008-8-25 15:55
0
雪    币: 216
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
E文的。。。有没有中文的
2008-8-25 16:23
0
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
申请发送wm_gettext消息复制文本对应的一个窗口,成为一个缓冲所提供的来电。

语法

此消息的发送,请sendmessage功能如下。
lresult = sendmessage ( / /返回lresult在lresult (的hWnd ) hwndcontrol , / /处理到目的地的管制( uint ) wm_gettext , / /消息ID ( wparam ) wparam , / / = ( wparam ) ( ) wparam ; ( lparam ) lparam / / = ( lparam ) ( ) lparam ; ) ;
参数

wparam
指定的最大数目tchars要复制的,包括终止空字符。
Windows NT/2000/XP中:的ANSI应用程序可能有字符串在缓冲区减少在大小(以最低限度的一半的wparam值) ,由于从ANSI转换为Unicode 。

lparam
指针的缓冲区是接收文字。
返回值

返回值是多少tchars复制,但不包括终止空字符。

言论

该defwindowproc功能复制文本相关的窗口到指定的缓冲区和效益的字符数复制。请注意,非文字的静态控制,这使您的文字与控制本来是创造,那就是身份证号码。不过,它可以让您的ID非文本静态控制,原先创建的。也就是说,如果您后来用了一个stm_setimage改变它原来的编号仍然会回来。

为编辑控件,该文本要复制的是内容的编辑控制。一个组合框,文本的内容编辑控制(或静态文本)部分的组合框。为一个按钮,这个文本是按钮名称。其他Windows ,这个文本是窗口标题。复制文本的一个项目在一个列表框,一个应用程序可以使用该lb_gettext讯息。

当wm_gettext邮件发送到一个静态控制与ss_icon作风,句柄的图标将被退回,在头四个字节的缓冲区指出,由lparam 。这是事实,只有当wm_settext邮件已被用来设置图标。

丰富的编辑:如果文本要复制超过64K的,使用,无论是em_streamout或em_getseltext讯息。

Windows 2000/XP的:发送wm_gettext信息到一个非文本静态控制,如一个静态的位图或静态的图标控制,不会返回一个字符串值。相反,它返回零。此外,在先前版本的Microsoft Windows和Microsoft Windows NT ,应用可发送wm_gettext信息到一个非文本静态控制,检索控制的ID 。中取出一个控制的ID在Windows 2000/XP的,应用程序可以使用getwindowlong通过gwl_id作为指数值或getwindowlongptr使用gwlp_id 。
2008-8-25 19:37
0
游客
登录 | 注册 方可回帖
返回