Set ObjCAD = GetObject(, "AutoCAD.Application")
count = ObjCAD.Documents.count
For index = 0 To count - 1
set ThisDrawing=ObjCAD.Documents.Item(index)
ThisDrawing.SendCommand ("(if (member ""tch_initstart.arx"" (arx))(command ""tmnload""))(princ)" & vbCr)
Next
可能用到的API(附加API解释):
'获取桌面的hwnd
Public Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long
'获取窗口hwnd
Public Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
'取得窗口caption
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
'激活某个窗口
Public Declare Function SetActiveWindow Lib "user32" Alias "SetActiveWindow" (ByVal hwnd As Long) As Long
然后试试用getobject()如果这不行的话只能用windows API来 snap了