[求助]更改AutoCAD应用程序的图标和标题栏
斑竹,请问AutoCADVBA二次开发教程中第十五章的“更改AutoCAD应用程序的图标和标题栏“的程序能在2004版中应用吗? 可以啊 <P>Public Sub SetTitle(ByVal Title As String)<BR> Dim AcadHwnd As Long<BR> Dim hIcon As Long<BR> <BR> ' 获取AutoCAD应用程序的窗口句柄<BR> AcadHwnd = GetParent(GetParent(ThisDrawing.hwnd))<BR> ' 设置标题<BR> SetWindowText AcadHwnd, Title<BR>End Sub</P><P>Public Sub SetIcon(ByVal FileName As String)<BR> Dim AcadHwnd As Long<BR> Dim hIcon As Long<BR> <BR> ' 获取AutoCAD应用程序的窗口句柄<BR> AcadHwnd = GetParent(GetParent(ThisDrawing.hwnd))<BR> ' 从文件载入图标,16*16大小<BR> hIcon = LoadImage(0&, FileName, IMAGE_ICON, 32, 32, LR_LOADFROMFILE)<BR> If hIcon <> 0 Then<BR> ' 发送消息,设置图标<BR> Call SendMessage(AcadHwnd, WM_SETICON, 0, ByVal hIcon)<BR> End If<BR>End Sub</P>
<P>各位专家,调试过程中AcadHwnd值总为零,这是什么原因?</P>
<P> </P> Public Sub SetCaption(ByVal NewCaption As String)<BR> SetWindowText Application.hwnd, NewCaption<BR>End Sub<BR> 哪里有AutoCADVBA二次开发教程可买?
页:
[1]