N
Nandakumar Sankaran
I'm trying to create a native custom window through managed code.
Essentially I want to wrap a native custom window class into a managed
custom control. So I tried calling the Win32 API CreateWindowEx() using
P/Invoke. This API takes a parent window handle and since .NETCF's controls
do not expose a handle, I created a MessageWindow object and passed its HWnd
member to CreateWindowEx(). I obtained the instance handle through another
Win32API GetModuleHandle(null). The call to CreateWindowEx() succeeds and I
get a window handle as the return value. However the window never shows up
on the form!
The same code works fine on the desktop. The only change being that the
parent window handle is actually the Form.Handle member.
To reduce the number of unknowns, I tried the above on a standard EDIT
control with
the same results. What am I missing?
Nandakumar
Essentially I want to wrap a native custom window class into a managed
custom control. So I tried calling the Win32 API CreateWindowEx() using
P/Invoke. This API takes a parent window handle and since .NETCF's controls
do not expose a handle, I created a MessageWindow object and passed its HWnd
member to CreateWindowEx(). I obtained the instance handle through another
Win32API GetModuleHandle(null). The call to CreateWindowEx() succeeds and I
get a window handle as the return value. However the window never shows up
on the form!
The same code works fine on the desktop. The only change being that the
parent window handle is actually the Form.Handle member.
To reduce the number of unknowns, I tried the above on a standard EDIT
control with
the same results. What am I missing?
Nandakumar