[VB6 ] 呼叫外部程式後改視窗名字

看板Visual_Basic作者 (膣屄人)時間9年前 (2015/06/09 15:58), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
小弟有個需求想請前輩幫忙,如標題,不知道哪裡出問題沒反應 程式碼如下 Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpC lassName As String, ByVal lpWindowName As String) As LongPublic Declare Functi on SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVa l lpString As String) As Long Sub Main() Dim ProcessID As Long Dim hwnd As Long Dim MyTitle As String MyTitle = "My First Program"ProcessID = Shell("CALC.EXE", vbNormalFocus) If ProcessID <> 0 Then hwnd = FindWindow("SciCalc", "Calculator" If ProcessID = 0 Or hwnd = 0 ThenꀠꀠMsgBox "Can't execute calculator"ꀠꀊEnd End If SetWindowText hwnd, MyTitle End Sub 請前輩幫忙看看哪邊有問題?謝謝 -- Sent from my Android -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.231.79.92 ※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1433836692.A.E60.html

06/11 11:57, , 1F
來問問題連排版也不排好,根本懶得看~~
06/11 11:57, 1F
文章代碼(AID): #1LTfoKvW (Visual_Basic)
文章代碼(AID): #1LTfoKvW (Visual_Basic)