[VB6 ] 呼叫外部程式后改视窗名字

楼主: k10120421 (膣屄人)   2015-06-09 15:58:10
小弟有个需求想请前辈帮忙,如标题,不知道哪里出问题没反应
程式码如下
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
请前辈帮忙看看哪边有问题?谢谢
作者: wenyonba (射后不理很XX啊!!!!)   2015-06-11 11:57:00
来问问题连排版也不排好,根本懒得看~~

Links booklink

Contact Us: admin [ a t ] ucptt.com