qwe11914 發表於 2017-9-29 19:17:46

偵測遊戲進程~

本帖最後由 qwe11914 於 2017-9-29 19:19 編輯

小弟拿龍大開源的MS專案想要改成使用爆爆王的專案
以下是龍大偵測程式碼部分:
Private Sub tsiGameLock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsiGameLock.Click
        OpenProcessByWindow_LA("MapleStory", "StartUpDlgClass")
    End Sub

  Private Sub tmDetect_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmDetect.Tick
        If FindWindow("MapleStoryClass", "MapleStory") <> 0 Then
            MShWnd = FindWindow("MapleStoryClass", "MapleStory")
            tmDetect.Enabled = False
        End If
    End Sub


Public Sub OpenProcessByWindow_LA(ByVal lpWindowName As String, Optional ByVal lpClassName As String = vbNullString)
        MShWnd = FindWindow(lpClassName, lpWindowName)
        GetWindowThreadProcessId(MShWnd, MSpid)
        MShprocess = OpenProcessAPI(&H1F0FFF, False, MSpid)
        If MSpid <> 0 Then
            CEInitialize(MSpid, MShprocess)
            If lpClassName = "StartUpDlgClass" Then
                tmDetect.Enabled = True
                tmDetect.Enabled = 1000
                CloseGame_LA()
            End If
            Form1.Text = "~偵測成功~" & MSpId
        Else
            MsgBox("~偵測失敗~")
        End If
    End Sub

請問紅色部分要如何修改 才能成功讀取進程
小弟目前是把這行 OpenProcessByWindow_LA("MapleStory", "StartUpDlgClass")
改成OpenProcessByWindow_LA("爆爆王")
就能讀取視窗名稱 但在遊戲裡開啟功能沒有反應!
所以想請教各位大大們~
願意幫小弟的請留言或+RC:qwe31914
感激不盡~
P.S 感謝龍大的開源專案~

qwas963563 發表於 2017-9-29 19:20:38

建議整個重改 要用的API 留著就好

miss11265138 發表於 2017-10-1 14:53:15

感謝分享 領個幣

sam2016hsu 發表於 2017-10-3 09:52:38

有封閉耶

許晨瑀 發表於 2017-10-3 10:00:37

有點複雜呢~:lol:lol

abcd20010310 發表於 2017-10-3 21:09:09

阿阿 發表於 2017-10-5 00:16:26

路過拿封閉喔

小夜鶯 發表於 2017-10-5 02:30:21

asz7999 發表於 2017-10-6 15:27:51

幫推等內行的解答
領楓幣~~

s980070 發表於 2017-10-9 13:30:10

OpenProcessByWindow_LA("爆爆王","StartUpDlgClass")
試試

he10910 發表於 2017-10-9 14:09:09

雖然看不懂 但還是幫推個~

abcd20010310 發表於 2017-10-9 14:16:44

fiycat11 發表於 2017-10-13 20:30:49

路過嶺楓幣:D

rs876070 發表於 2017-10-18 11:45:58

a22697380 發表於 2017-10-24 00:39:16

你應該不可能只改那一段吧 ...
MapleStory = 新楓之谷 將MapleStory 都改成:爆爆王

另))雖然我不懂 但看見深澳文 我還是給個推
已加您RC了 懇請接受好友 傳授小弟一些技術 !!
頁: [1] 2
查看完整版本: 偵測遊戲進程~