David Adam david.adam.cnrs@gmail.com writes:
@@ -33,8 +33,9 @@ static LPDIRECTDRAW lpDD = NULL; static LPDIRECTDRAWSURFACE lpDDSPrimary = NULL; static LPDIRECTDRAWSURFACE lpDDSBack = NULL; static WNDCLASS wc; -static HWND hwnd; +static HWND hwnd, hwnd2; static int modes_cnt; +static BOOL success;
That boolean make much sense, especially with this name. If you want to check that you have a valid window you should test the window handle. Same with your createwindow function, it should simply return the handle.