views:

194

answers:

2

I am trying to create a window (not a WinForm) using CreateWindowEx and RegisterClass. I have figured out how to use CreateWindowEx, but I am stuck on a few things with RegisterClass. In the WNDCLASS struct, how do I set these:

WNDPROC lpfnWndProc It is a handle to the WndProc method that I want to have in C#.

HINSTANCE hInstance What is this a handle to? What is the "instance" in this case?

Thanks!

A: 

You can P/Invoke it, but why? What are you doing?

A Form is a window that handles that work for you.

280Z28
+2  A: 

HINSTANCE is the handle to your module (dll). WNDPROC is a function pointer that will be called with window messages.

jeffamaphone