tdmj 发表于 2006-5-29 18:02:00

获得AutoCAD应用程序窗口的句柄

本帖最后由 作者 于 2006-5-30 21:20:21 编辑 <br /><br /> [转载]获得AutoCAD应用程序窗口的句柄
<DIV style="PADDING-RIGHT: 0px; MARGIN-TOP: 10px; FONT-SIZE: 9pt; OVERFLOW-X: hidden; WIDTH: 97%; WORD-BREAK: break-all; TEXT-INDENT: 24px; LINE-HEIGHT: normal; HEIGHT: 200px; WORD-WRAP: break-word" onload="this.style.overflowX='auto';">
<P>Attribute VB_Name = "GetAcadHwnd" 'Purpose ' Returns the handle to the AutoCAD application window 'Notes ' Use this when you need a handle to AutoCAD's main window rather than a document window</P>
<P>Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long</P>
<P>Public Function GetAcadHwnd() As Long</P>
<P>GetAcadHwnd = GetParent(GetParent(ThisDrawing.hwnd))</P>
<P>End Function</P>
<P>哪位xd能帮解释一下ThisDrawing具体是个什么,是个autocad文件还是其它什么。</P></DIV>

liub951030 发表于 2007-1-17 18:54:00

VBA中ThisDrawing是指的当前文档.

pyeye 发表于 2008-7-18 18:02:00

这里应该用acadApp.Activedocument代替
页: [1]
查看完整版本: 获得AutoCAD应用程序窗口的句柄