Different window class

  • Thread starter Thread starter Dragon
  • Start date Start date
D

Dragon

Hello world! 8-]

I'm trying to create a form that will have different window class. I have
overridden the CreateParams property of a form as follows:
~
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams

Get

Dim tempCP As CreateParams = MyBase.CreateParams

tempCP.ClassName = "PlaySmth.Class"

Return tempCP

End Get

End Property

~

.... but I'm getting System.ComponentModel.Win32Exception.

I think I have to register this new window class, but I can't do this
without original class info. But

~

Dim WC as WNDCLASS

GetClassInfo(0, Old_Class_Name, WC)

~

failed.

So, does anyone know how to get info on old window class, or, maybe, a
different way to change class of a window being created?

Thanks in advance.

Dragon
 
I think I have to register this new window class, but I can't do this
without original class info. But

~

Dim WC as WNDCLASS

GetClassInfo(0, Old_Class_Name, WC)

~

failed.


Failed in what way?



Mattias
 
Failed in what way?

I mean, GetClassInfo returned 0, and there were no changes in the WC
structure.
Marshal.GetLastWin32Error gave me 87.

I suspect the trouble is with first GetClassInfo parameter. I assumed that
old class was created by OS, but it seems that it wasn't. Unfortunately, I
have no idea what should I substitute for hInstance.

Any suggestions?
 
Back
Top