2 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
13 #include "testnative.h"
15 #ifdef TEST_NATIVE_OS2
17 #define WIN_CLIENT_CLASS "SDL Test"
19 static void *CreateWindowNative(int w, int h);
20 static void DestroyWindowNative(void *window);
22 NativeWindowFactory OS2WindowFactory = {
28 static void *CreateWindowNative(int w, int h)
32 ULONG ulFrameFlags = FCF_TASKLIST | FCF_DLGBORDER | FCF_TITLEBAR |
33 FCF_SYSMENU | FCF_SHELLPOSITION |
34 FCF_SIZEBORDER | FCF_MINBUTTON | FCF_MAXBUTTON;
36 WinRegisterClass( 0, WIN_CLIENT_CLASS, WinDefWindowProc,
37 CS_SIZEREDRAW | CS_MOVENOTIFY,
38 sizeof(ULONG) ); // We should have minimum 4 bytes.
40 hwndFrame = WinCreateStdWindow( HWND_DESKTOP, 0, &ulFrameFlags,
41 WIN_CLIENT_CLASS, "SDL Test", 0, 0, 1, &hwnd );
42 if ( hwndFrame == NULLHANDLE )
47 WinSetWindowPos( hwndFrame, HWND_TOP, 0, 0, w, h,
48 SWP_ZORDER | SWP_ACTIVATE | SWP_SIZE | SWP_SHOW );
50 return (void *)hwndFrame; // We may returns client or frame window handle
51 // for SDL_CreateWindowFrom().
54 static void DestroyWindowNative(void *window)
56 WinDestroyWindow( (HWND)window );
59 #endif /* TEST_NATIVE_OS2 */