几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(VB.NET/C#) (http://www.dimcax.com/hust/forumdisplay.php?f=176)
-   -   【转帖】获得autocad应用程序窗口的句柄 (http://www.dimcax.com/hust/showthread.php?t=9967)

yang686526 2009-04-21 06:01 PM

【转帖】获得autocad应用程序窗口的句柄
 
获得autocad应用程序窗口的句柄
www.dimcax.com
获得autocad应用程序窗口的句柄[转载]获得autocad应用程序窗口的句柄
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
public declare function getparent lib "user32" (byval hwnd as long) as long
public function getacadhwnd() as long
getacadhwnd = getparent(getparent(thisdrawing.hwnd))
end function
哪位xd能帮解释一下thisdrawing具体是个什么,是个autocad文件还是其它什么。
[此贴子已经被作者于
vba中thisdrawing是指的当前文档.
这里应该用acadapp.activedocument代替


所有的时间均为北京时间。 现在的时间是 02:39 AM.