Original Post
Lo All,
This piece of code for clipping a window is crashing my program, has anyone got any ideas whats wrong with it?
Thanks in Advance...
CoiN
[edited by - CoiN on February 24, 2003 3:21:32 PM]
// Set Window Clipping
LPDIRECTDRAWCLIPPER DDraw_Clip_Window(LPDIRECTDRAW7 lpdd, LPDIRECTDRAWSURFACE7 lpddsprimary, HWND main_window_handle)
{
LPDIRECTDRAWCLIPPER lpddclipperwin;
// Create the window clipper
if (FAILED(lpdd->CreateClipper(0,&lpddclipperwin,NULL)))
return NULL;
// Set the dimensions of the window to clipperwin
if (FAILED(lpddclipperwin->SetHWnd(0, main_window_handle)))
return NULL;
// Set the Clipper
if (FAILED(lpddsprimary->SetClipper(lpddclipperwin)))
return NULL;
return lpddclipperwin;
}