jinyongjun 发表于 2005-2-6 10:51:00

[求助]如何把AUTOCAD界面左上角"AUTOCAD 2002"换为自己想要写上去的文字,用VBA编

[求助]如何把AUTOCAD界面左上角"AUTOCAD 2002"换为自己想要写上去的文字,用VBA编程如何把AUTOCAD界面左上角"AUTOCAD 2002"换为自己想要写上去的文字,用VBA编程

ntchjie 发表于 2005-2-6 14:31:00

VB代码


Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long<BR>Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long<BR><BR>Dim hw<BR>Dim acadobj As Object<BR>Set acadobj = GetObject(, "AutoCAD.Application.16")<BR>If err Then Exit Function<BR>Set acaddoc = acadobj.ActiveDocument<BR>hw = GetParent(GetParent(acaddoc.hwnd))<BR>SetWindowText hw, “你好!!”<BR>

jinyongjun 发表于 2005-2-7 13:31:00

十分感谢,已成功运行!
页: [1]
查看完整版本: [求助]如何把AUTOCAD界面左上角"AUTOCAD 2002"换为自己想要写上去的文