mayuezxl 发表于 2005-9-5 11:45:00

如何使vb界面在cad前面

各位请帮个忙,运行vb后打开cad,怎么样使vb界面在cad的前面,最大化cad窗口后同样使vb窗口在前面。谢谢

wyj7485 发表于 2005-9-5 11:58:00

<P>如何让一个 App 永远保持在最上层</P>
<P>Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long</P>
<P>Const SWP_NOMOVE = &amp;H2 '不更动目前视窗位置<BR>Const SWP_NOSIZE = &amp;H1 '不更动目前视窗大小<BR>Const HWND_TOPMOST = -1 '设定为最上层<BR>Const HWND_NOTOPMOST = -2 '取消最上层设定<BR>Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE</P>
<P>'将 APP 视窗设定成永远保持在最上层</P>
<P>'取消最上层设定<BR>'SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS</P>
<P><BR>Private Sub Form_Load()<BR>SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS</P>
<P>End Sub</P>
页: [1]
查看完整版本: 如何使vb界面在cad前面