如何截取QQ华夏游戏窗口的文字

lishiqian 2009-03-06 04:22:25
如何截取QQ华夏游戏窗口的文字
有没有代码或者类似代码
...全文
164 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lishiqian 2009-03-06
  • 打赏
  • 举报
回复
是不要加什么引用,大师们指导一下
lishiqian 2009-03-06
  • 打赏
  • 举报
回复
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
未定义
lishiqian 2009-03-06
  • 打赏
  • 举报
回复
怎么调试不了
anzhaozy 2009-03-06
  • 打赏
  • 举报
回复


Option Explicit


Private Sub cmdGetClass_Click()
'----------------------------------------------------------------------------------------------------------
'This sub locates information about a window when you select
'it from the list box.
'----------------------------------------------------------------------------------------------------------

Dim lngHand As Long
Dim strName As String * 255
Dim wndClass As wndClass
Dim lngProcID As Long
Dim rctTemp As RECT

'Locate the selected window and get its handle.
lngHand = FindWindow(vbNullString, txtTitle.Text)

'Using the handle obtained from FindWindow, get all class information
'about the selected window.
GetClassName lngHand, strName, Len(strName)

'If the name in the text box doesn't match a system window tell the user.
'Otherwise, get the process id and the window size info.
If Left$(strName, 1) = vbNullChar Then
lblClassName.Caption = "Window Not Found!!!"
Else
lblClassName.Caption = "Class Name: " & strName
GetWindowThreadProcessId lngHand, lngProcID
GetWindowRect lngHand, rctTemp
End If

'Load the labels with the info retrieved.
lblProcessID = "ProcessID: " & lngProcID
lblTop = "Top: " & rctTemp.Top
lblBottom = "Bottom: " & rctTemp.Bottom
lblLeft = "Left: " & rctTemp.Left
lblRight = "Right: " & rctTemp.Right

End Sub


Private Sub cmdRefresh_Click()

'Clear the list box and reload it with the current windows.
lstOpenWindows.Clear
lblCount.Caption = GetOpenWindowNames & " open Windows."

End Sub


Private Sub cmdActivate_Click()
'----------------------------------------------------------------------------------------------------------
'This sub activates the selected window.
'----------------------------------------------------------------------------------------------------------

'Variable to hold the handle to the window.
Dim lngHand As Long

'Find the window by class or title.
If Trim$(lblClassName.Caption) = "" Then
lngHand = FindWindow(vbNullChar, Trim$(txtTitle.Text))
Else
lngHand = FindWindow(Right$(lblClassName.Caption, (Len(lblClassName) - 12)), lstOpenWindows.Text)
End If

'Activate the selected window.
'Some windows are hidden so it will make the application the input app.
BringWindowToTop lngHand

End Sub



Private Sub cmdRefreshClass_Click()

Call cmdGetClass_Click

End Sub

Private Sub Form_Load()

'Make our app the top most window in the system.
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE

'Highlight the text in txtTitle.
txtTitle.SelLength = Len(txtTitle.Text)

lblCount.Caption = GetOpenWindowNames & " open Windows."

End Sub


Private Sub lstOpenWindows_Click()

'Call the hidden cmdGetClass button.
txtTitle.Text = lstOpenWindows.Text
Call cmdGetClass_Click

End Sub


Private Sub tmrWinClass_Timer()

'Check every 100 ms for the current application int the
'system and load it's info to our form.
Dim lngHand As Long
Dim strName As String * 255

lngHand = GetForegroundWindow

GetWindowText lngHand, strName, Len(strName)
lblCurrent.Caption = strName

GetClassName lngHand, strName, Len(strName)
lblClass.Caption = strName
End Sub

anzhaozy 2009-03-06
  • 打赏
  • 举报
回复

Option Explicit

'----------------------------------------------------------------------------------------------------------
'Author: Jonathan Morrison
'Date: 6/13/1998
'----------------------------------------------------------------------------------------------------------
'This is the main code module. It contains all of the API declares and CONST's
'
'This was done quick and dirty so if I didn't comment something or if there is a bug just let me know @:
' jonathan.morrison@aig.com
' OR
' jonathanm@mindspring.com
'----------------------------------------------------------------------------------------------------------

'C language TypeDef to hold the information about a Windows class.
Type wndClass
style As Long
lpfnwndproc As Long
cbClsextra As Long
cbWndExtra2 As Long
hInstance As Long
hIcon As Long
hCursor As Long
hbrBackground As Long
lpszMenuName As String
lpszClassName As String
End Type

'C language TypeDef to hold the size information for a given window.
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type


'API Declares
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, _
lpdwProcessId As Long) As Long

Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, _
ByVal lpClassName As String, _
ByVal nMaxCount As Long) _
As Long

Declare Function GetDesktopWindow Lib "user32" () As Long

Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, _
ByVal lpString As String, ByVal cch As Long) _
As Long

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal _
hWndInsertAfter As Long, ByVal X As Long, _
ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long

Declare Function GetActiveWindow Lib "user32" () As Long

Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long

Declare Function GetForegroundWindow Lib "user32" () As Long

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long

Declare Function GetClassInfo Lib "user32" Alias "GetClassInfoA" (ByVal hInstance As Long, _
ByVal lpClassName As String, _
lpWndClass As wndClass) As Long

'----------------------------------------------------------------------------------------------------------
Public Const WM_ACTIVATE = &H6
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const HWND_TOPMOST = -1
Public Const GW_CHILD = 5
Public Const GW_HWNDNEXT = 2
'----------------------------------------------------------------------------------------------------------



Public Function GetOpenWindowNames() As Long
'----------------------------------------------------------------------------------------------------------
'Name: Function GetOpenWindowNames()
'
'Purpose: To retrieve all open windows in the system.
'
'Parameters: N/A
'
'Return: NONE
'----------------------------------------------------------------------------------------------------------

'Declare local variables
Dim lngDeskTopHandle As Long 'Used to hold the value of the Desktop handle.
Dim lngHand As Long 'Used to hold each windows handle as it loops.
Dim strName As String * 255 'Fixed length string passed to GetWindowText API call.
Dim lngWindowCount As Long 'Counter used to return the numberof open windows in the system.

'Get the handle for the desktop.
lngDeskTopHandle = GetDesktopWindow()

'Get the first child of the desktop window.
'(Note: The desktop is the parent of all windows in the system.
lngHand = GetWindow(lngDeskTopHandle, GW_CHILD)

'set the window counter to 1.
lngWindowCount = 1

'Loop while there are still open windows.
Do While lngHand <> 0

'Get the title of the next window in the window list.
GetWindowText lngHand, strName, Len(strName)

'Get the sibling of the current window.
lngHand = GetWindow(lngHand, GW_HWNDNEXT)

'Make sure the window has a title; and if it does add it to the list.
If Left$(strName, 1) <> vbNullChar Then
frmClassFinder.lstOpenWindows.AddItem Left$(strName, InStr(1, strName, vbNullChar))
lngWindowCount = lngWindowCount + 1
End If
Loop

'Return the number of windows opened.
GetOpenWindowNames = lngWindowCount

End Function





【重要提示】本资源设置为0积分下载,若非0积分请勿轻易下载 亲爱的CSDN用户: 首先感谢你点进这个资源页面。我需要提前说明一个重要情况: 本资源原本已设置为“0积分下载”,即作者希望完全免费共享。但CSDN平台有时会根据文件的下载热度、文件大小、用户权限等因素,自动将部分资源的积分调整为非0数值(如1积分、2积分、5积分等)。这是平台系统的自动行为,而非作者本人的设定。 因此,如果你当前看到该资源的下载所需积分不是0(例如显示为1、2、3……),请谨慎决定是否下载。 如果你按照非0积分支付并下载后发现资源内容不符合预期、链接失效,或者实际上该资源本应是免费的,作者无法为此承担积分损失或退还操作。强烈建议:仅在页面显示为0积分时进行下载。 另外,本资源描述中并未直接提供具体的下载地址或外部链接,因为它本身是一个通过CSDN官方上传通道提交的文件/内容包。如果你看到描述中没有外部网盘地址,这是正常的——资源文件应通过CSDN内置的“下载”按钮获取。若因平台积分显示异常导致你支付了积分,请优先联系CSDN客服咨询积分退还政策,作者没有权限修改平台自动设定的积分值。 感谢你的理解与支持。技术分享本应开放,但受限于平台规则,特此提醒如上。祝学习进步!
内容概要:本文针对基于无刷直流电机的电子机械制动执行器开展系统建模与仿真研究,重点利用Simulink平台构建其动态数学模型,深入分析电机驱动特性、力矩传递机制及制动控制策略的协同作用。研究涵盖系统整体架构设计、关键部件建模、控制算法实现,并通过多工况仿真实验验证系统在不同运行条件下的响应特性和控制稳定性,全面评估其制动性能与可靠性,旨在为电子机械制动系统的工程化设计与优化提供坚实的理论支撑和有效的技术路径。; 适合人群:具备电机控制、汽车电子、自动化或机电一体化等相关专业背景的研究生、科研人员及从事智能制动系统开发的工程技术人员。; 使用场景及目标:①应用于电动车辆、智能底盘或先进制动系统中的执行器设计与性能仿真验证;②为高校及科研院所开展相关课题研究、学位论文撰写提供完整的建模思路与仿真案例参考;③帮助研究人员掌握基于Simulink的机电一体化系统多域协同建模、仿真分析与控制策略开发的核心方法。; 阅读建议:读者应在熟悉无刷直流电机基本原理和制动系统工作流程的基础上,结合Simulink软件动手实践模型搭建,重点关注各子模块的接口关系、控制参数的整定过程以及仿真结果的动态响应分析,建议同步查阅电机控制、车辆动力学及现代控制理论的相关文献以深化理解。

1,488

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧