引用:
原帖由 u-know 于 2008-4-28 13:29 发表 , S# G/ p3 p) S9 C `) X d( @8 ^
顺便问下,如何调用函数起到双开作用(不能启动大于2个魔力窗口)
+ ?3 x4 v$ C/ {' V# n给你个函数,自己进行调用。
复制内容到剪贴板
代码:
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 Function GetCgNum() As Integer
Dim CgClassName As String
Dim CgNum As Integer
Dim Hwnd As Long
CgNum = 0
CgClassName = "CrossGate" '此处根据你的CG类名进行更改
Hwnd = FindWindowEx(0, 0, CgClassName, vbNullString)
While Hwnd > 0
CgNum = CgNum + 1
Hwnd = FindWindowEx(0, Hwnd, CgClassName, vbNullString)
Wend
GetCgNum = CgNum '返回CG的个数
End Function
调用 GetCgNum 返回CG个数。