求FindWindowsEx例程
各位高手!!
我想用FindWindowsEx截获一个(别人编译好的)应用程序的叫AAA的窗体中,
ComBoBox控件中选定的文本和List控件中增加的项目。谢谢
问题点数:20、回复次数:6Top
1 楼bob008(冻冬)回复于 2002-09-20 19:36:14 得分 0
list控件使用ADDITEM就好了吗!你的这个东东应该是很简单的!自己写啊!Top
2 楼smx717616(又笨又不努力)回复于 2002-09-20 19:36:54 得分 0
upTop
3 楼flashboy(爱写程序的小绵羊)回复于 2002-09-20 21:56:10 得分 5
你不会是想偷窥别人信息吧,就象某些QQ密码盗窃器一样,使用时钟轮循。。。。。。。
1.首先获得目标程序主窗口句柄。使用FindEWindow
HWND hParent=::FindWindow(NULL,"AAA");
2.获得主窗口上COMBOX的HWND。
hComBox=::FindWindowEx(hParent,NULL,"COMBOBOX",NULL);
"COMBOBOX"是WINDOWS中下拉列表矿的标准类名,如果对方的程序是VB或者BCB或者DELPHI写的,可能类名不同。你可以使用VC自带的SPY++去看一下就知道了。
Top
4 楼drinkcat(醉猫)回复于 2002-09-20 22:26:10 得分 0
to 快活一刀
我只是想编个偷懒的小东东,只录入一次不用重复录入罢了;)~~~
请问有例程吗??
Top
5 楼chenyu5188(来自东方的狼)回复于 2002-09-20 23:11:03 得分 0
UPTop
6 楼myhfit()回复于 2002-09-21 22:55:12 得分 15
Const WS_CHILD = &H40000000
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
Const SW_HIDE = 0
Const SW_NORMAL = 1
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Dim tWnd As Long, bWnd As Long, ncWnd As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim R As RECT
'Get the taskbar's window handle
tWnd = FindWindow("Shell_TrayWnd", vbNullString)
'Get the start-button's window handle
bWnd = FindWindowEx(tWnd, ByVal 0&, "BUTTON", vbNullString)
'Get the start button's position
GetWindowRect bWnd, R
'Create a new button
ncWnd = CreateWindowEx(ByVal 0&, "BUTTON", "Hello !", WS_CHILD, 0, 0, R.Right - R.Left, R.Bottom - R.Top, tWnd, ByVal 0&, App.hInstance, ByVal 0&)
'Show our button
ShowWindow ncWnd, SW_NORMAL
'Hide the start button
ShowWindow bWnd, SW_HIDE
End Sub
Private Sub Form_Unload(Cancel As Integer)
'show the start button
ShowWindow bWnd, SW_NORMAL
'destroy our button
DestroyWindow ncWnd
End Sub
Top




