当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > VB 从零开始编外挂(一)

ASP.NET
Check Your Internet Connection With C#
Essential .NET读书笔记
可用来显示空值的时间选择控件3
学习Keny boy sps区域列表的管理入口程序
[译]Visual Basic 2005在语言上的增强(十)应用程序级别事件
什么时候应该使用 ==?什么时候应该使用 Equals?
“String.Equals(string)”和“==”那个快?
应用ADO.net得到系统表信息
不会被其他窗体遮挡的抓图,使用API的PrintWindow函数
关于.net下服务安装
水晶报表4.6的使用示例
超大正整数加法与乘法最笨方法实现
实现web页面的局部刷新
动态生成带事件的MsFlexGrid
一些codedom的资料。
WML教程3:任务与导航-赋值与数据交换
WML教程7:WML的事件
WML教程10:分组选择控件(Optgroup)和复杂实例
WML教程5:任务和任务屏蔽
VS.NET安装部署深入研究

ASP.NET 中的 VB 从零开始编外挂(一)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 58 ::
收藏到网摘: n/a

--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VB API函数:
FindWindow ←寻找窗口列表中第一个符合指定条件的顶级窗口
GetWindowThreadProcessId ←获取与指定窗口关联在一起的一个进程和线程标识符
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
FindWindow

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

GetWindowThreadProcessId

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long)
As Long
--------------------------------------------------------------------------------------------------------------------------------------------------------

需要的控件:Label、Timer
-------------------------------------------------------------------------------------------------------------------------------------------------------- 自定义函数:
Dim hwnd As Long
-------------------------------------------------------------------------------------------------------------------------------------------------------- 源代码:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long)As Long
Private Sub Timer1_Timer()
Dim hwnd As Long' 储存 FindWindow 函数返回的句柄
hwnd = FindWindow(vbNullString, "Windows Media Player")' 取得进程标识符
'只要把Windows Media Player换成游戏的名称就可了!
If hwnd = 0 Then
Label1.Caption = "游戏未运行"
Else
Label1.Caption = "游戏已运行"
End If
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------------
点击给我留言
---------------------------------------------------------------------------------------------------------------