I'm trying to create a modeless dialog for ACAD 2005 with VB .NET. As I got read in several discussions this should be possible with using the SetWindowLong function. I have tried but could not succeed. Here is my code:
Public Const GWL_HWNDPARENT = (-8)
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As IntPtr, ByVal nIndex As Long, ByVal wNewLong As Long) As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim appACAD As Autodesk.AutoCAD.Interop.AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
SetWindowLong(Me.Handle, GWL_HWNDPARENT, acadApp.HWND)
What is wrong with this code? Can anyone please correct it?