【发布时间】:2016-05-20 22:41:21
【问题描述】:
我正在尝试制作一个应用程序,它可以在我的屏幕上叠加一个透明图像。我的目标是为没有十字准线的游戏制作十字准线。我的想法是检测活动窗口标题是否与游戏名称匹配,如果匹配则显示覆盖的十字准线。我将如何制作屏幕覆盖?这是我当前的代码:
Private Function GetCaption() As String
Dim Caption As New System.Text.StringBuilder(256)
Dim hWnd As IntPtr = GetForegroundWindow()
GetWindowText(hWnd, Caption, Caption.Capacity)
Return Caption.ToString()
End Function
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If GetCaption() = "Game NameOf" Then
'Display Crosshair
End If
End sub
【问题讨论】: