T
Tibby
Okay, here's my calling code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
mdiClient = New MDIClientWindow(Me, Me.Handle) '**
SetClassLong(mdiClient.Handle, GCL_HBRBACKGROUND, 0)
End Sub ' End Form1_Load
Here's the Code Being Called:
Public Sub New(ByVal i As IMDIClientNotify, ByVal handle As IntPtr)
'Find the MDI Client window handle:
GetWindows(handle)
If Not hWndMdiClient.ToInt32 = IntPtr.Zero.ToInt32 Then
MyBase.AssignHandle(hWndMdiClient)
End If
notify = i
End Sub ' End Sub New
And here is the Interface:
Public Interface IMDIClientNotify
Sub WndProc(ByRef m As Message, ByRef doDefault As Boolean)
End Interface
Here's the origional C# code for the above functions:
private void mfrmMDIClientPaint_Load(object sender, System.EventArgs e)
{
// Start processing for MDIClient window messages:
mdiClient = new MDIClientWindow(this, this.Handle);
// Stop the default window proc from drawing the MDI background
// with the brush:
UnManagedMethods.SetClassLong(
mdiClient.Handle,
UnManagedMethods.GCL_HBRBACKGROUND,
0);
}
public MDIClientWindow(IMDIClientNotify i, IntPtr handle)
{
// Find the MDI Client window handle:
GetWindows(handle);
if (hWndMdiClient != IntPtr.Zero)
{
this.AssignHandle(hWndMdiClient);
}
this.notify = i;
}
public interface IMDIClientNotify
{
void WndProc(ref Message m, ref bool doDefault);
}
The '** Mark is where things go heywire!
"Additional information: Specified cast is not valid." is the exact error
that comes up, if that helps...
Thanks again,
Sueffel
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
mdiClient = New MDIClientWindow(Me, Me.Handle) '**
SetClassLong(mdiClient.Handle, GCL_HBRBACKGROUND, 0)
End Sub ' End Form1_Load
Here's the Code Being Called:
Public Sub New(ByVal i As IMDIClientNotify, ByVal handle As IntPtr)
'Find the MDI Client window handle:
GetWindows(handle)
If Not hWndMdiClient.ToInt32 = IntPtr.Zero.ToInt32 Then
MyBase.AssignHandle(hWndMdiClient)
End If
notify = i
End Sub ' End Sub New
And here is the Interface:
Public Interface IMDIClientNotify
Sub WndProc(ByRef m As Message, ByRef doDefault As Boolean)
End Interface
Here's the origional C# code for the above functions:
private void mfrmMDIClientPaint_Load(object sender, System.EventArgs e)
{
// Start processing for MDIClient window messages:
mdiClient = new MDIClientWindow(this, this.Handle);
// Stop the default window proc from drawing the MDI background
// with the brush:
UnManagedMethods.SetClassLong(
mdiClient.Handle,
UnManagedMethods.GCL_HBRBACKGROUND,
0);
}
public MDIClientWindow(IMDIClientNotify i, IntPtr handle)
{
// Find the MDI Client window handle:
GetWindows(handle);
if (hWndMdiClient != IntPtr.Zero)
{
this.AssignHandle(hWndMdiClient);
}
this.notify = i;
}
public interface IMDIClientNotify
{
void WndProc(ref Message m, ref bool doDefault);
}
The '** Mark is where things go heywire!
"Additional information: Specified cast is not valid." is the exact error
that comes up, if that helps...
Thanks again,
Sueffel