Dear experts, apologize if this question was already raised in the past, but I will be grateful if someone could tell me what I am doing wrong here:
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal dwImageType As Long, ByVal dwDesiredWidth As Long, ByVal dwDesiredHeight As Long, ByVal dwFlags As Long) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Long) As Integer
Then I get a Handler on the ICON file I want to substitute the default AutoCAD with:
Const IMAGE_ICON As Long = 1
Const WM_SETICON As Long = &H80
Const ICON_BIG As Long = 1
Const ICON_SMALL As Long = 0
Const LR_LOADFROMFILE As Long = &H10
Dim A_ICON As Long = LoadImage(Nothing, "xp218.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE)
then I try to update the current active document HWND with:
SendMessage(AcadApp.ActiveDocument.HWND, WM_SETICON, ICON_BIG, A_ICON)
SendMessage(AcadApp.ActiveDocument.HWND, WM_SETICON, ICON_SMALL, A_ICON)
with AcadApp defined as:
AcadApp As Autodesk.AutoCAD.Interop.AcadApplication
Unfortunately it does not work.
In advance, thanks for your valuable help.