作者saininniang (莎里奈)
看板Visual_Basic
标题[API ] SendMessage 怪问题
时间Fri Jul 25 01:02:36 2008
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (
ByVal hWnd As Long,
ByVal wMsg As Long,
ByVal wParam As Long,
ByVal lParam As String
) As Long
说明
hWnd Handle to the window whose window procedure will receive the message
Msg [in] Specifies the message to be sent.
wParam [in] Specifies additional message-specific information.
lParam [in] Specifies additional message-specific information.
-----------------------------------------------
说明
S为空字串
(1)
SendMessage handle_x , WM_GETTEXT , S , Len(S)
Text1.Text = S
结果:Text1.text仍是空字串
------------------------------------------
改为
(2)
SendMessage handle_x , WM_GETTEXT , Len(S) , S
Text1.Text = S
结果:Text1.text抓到我要的内容
怎麽会这样,是差在哪?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.160.248.200
※ 编辑: saininniang 来自: 218.160.245.109 (07/25 02:09)
1F:→ cole945:请查MSDN, WM_GETTEXT 07/25 02:10
2F:→ saininniang:原来如此,我终於了解了,感谢 07/25 03:21
3F:→ saininniang:为什麽大家那麽强,我那麽弱 07/25 03:21
4F:推 windwofswold:多翻文件 就会进步 07/25 19:30
5F:→ irlmpo:好奇怪的问题 @@> 07/28 14:38