关于程序启动是关闭命令行对话框
<BR><FONT face=宋体 size=2>有两个问题需要解决:<BR>1.关闭命令行对话框<BR></FONT><DIV style="MARGIN: 5px 20px 20px">
<DIV class=smallfont style="MARGIN-BOTTOM: 2px"><FONT face=宋体,verdana,arial,helvetica>代码:</DIV><PRE class=alt2 style="BORDER-RIGHT: 1px inset; PADDING-RIGHT: 6px; BORDER-TOP: 1px inset; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; MARGIN: 0px; OVERFLOW: auto; BORDER-LEFT: 1px inset; WIDTH: 99%; PADDING-TOP: 6px; BORDER-BOTTOM: 1px inset"><FONT style="FONT-SIZE: 10pt" face="宋体,verdana, Airal,Helvetica,Geneva">
<FONT face="courier new">
		CWnd *pWnd = acedGetAcadDockCmdLine();
		if(pWnd)
		{
			pWnd = pWnd->GetParent();
			if(pWnd)
			{
				pWnd = pWnd->GetParent();
				if(pWnd)
				{
					pWnd->ModifyStyle(0,WS_VISIBLE|WS_OVERLAPPED);
					pWnd->ShowWindow(SW_HIDE);
					pWnd->RedrawWindow();
					acedGetAcadFrame()->RecalcLayout();
				}
			}
		}
</FONT>
</FONT></PRE></FONT></DIV>
<DIV></DIV><BR><BR>已经解决。<BR><BR>2.程序启动时起作用<BR>最初以为直接在On_kInitAppMsg消息中运行上述代码即可,事实上不起作用,感觉关闭之后又显示出来了。(另外如果要在On_kInitAppMsg消息中控制视图zoom-e也不可以,控制视图代码如下)<BR></FONT>
<DIV style="MARGIN: 5px 20px 20px">
<DIV class=smallfont style="MARGIN-BOTTOM: 2px"><FONT face=宋体,verdana,arial,helvetica>代码:</DIV><PRE class=alt2 style="BORDER-RIGHT: 1px inset; PADDING-RIGHT: 6px; BORDER-TOP: 1px inset; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; MARGIN: 0px; OVERFLOW: auto; BORDER-LEFT: 1px inset; WIDTH: 99%; PADDING-TOP: 6px; BORDER-BOTTOM: 1px inset"><FONT style="FONT-SIZE: 10pt" face="宋体,verdana, Airal,Helvetica,Geneva">
<FONT face="courier new">
void CGlobalFuns::zoomExt()
{
	// get the extents of the drawing
	AcDbViewTableRecord view;
	AcGePoint3d max =
		acdbHostApplicationServices()->workingDatabase()->extmax(),
		min = acdbHostApplicationServices()->workingDatabase()->extmin();
	AcGePoint2d max_2d (max, max);
	AcGePoint2d min_2d (min, min);
	// now set the view centre point
	view.setCenterPoint (min_2d + (max_2d - min_2d) / 2.0);
	// now height and width of view
	view.setHeight(max_2d - min_2d);
	view.setWidth (max_2d - min_2d);
	// set the view
	acedSetCurrentView (&view, NULL);
	// updates the extents
	acdbHostApplicationServices()->workingDatabase()->updateExt(TRUE);
}
</FONT>
</FONT></PRE></FONT></DIV>
<DIV></DIV><BR><BR>于是只好用autocad2004doc.lsp实现,发现也不尽如人意,讨论一下。</FONT>
页:
[1]