I have a third party unmanaged DLLs which requries a window handle to do some painting on. My attempts have been to pass the control::handle property to this DLLs.
The DLLs declaration expects a void* hWnd. Below is the declaration.
CyResult CyDisplayEx:: Open | ( | void * | aWindow, |
unsigned short | aColumns = 1 , | ||
unsigned short | aRows = 1 , | ||
bool | aFullScreen = false | ||
) | [virtual] |
What I did was is follows.
Panel* test = new Panel();
System:: Intptr handle = test->Handle;
void __pin* hwnd = (void*)handle;
CyDisplayEx:: Open(hwnd, 1,1, false);
The result & problem
The unmanaged DLL starts painting in the window area. It continues to update with significant flickering. At this point, I have not managed any of the paint event to that window.
Additional information about the 3rd party DLL.
I know that the DLL uses directdraw to paint in the window. It also has the following notes:
- Note:
- On Windows, the aWindow parameter must be a valid HWND (WIN32 SDK).
It is important that the user¡¯s window handling call the following functions on specific Windows events:WM_MOVE ==> OnMove( unsigned int aPosX, unsigned int aPosY );
WM_SIZE ==> OnSize( unsigned int aSizeX, unsigned int aSizeY );
WM_PAINT ==> OnPaint();
I have been strugling with this for almost a week

Thanks!