1 /* User-based primary surface driver
3 * Copyright 2000 TransGaming Technologies Inc.
14 #include "ddraw_private.h"
15 #include "dsurface/wndproc.h"
17 #include "debugtools.h"
19 DEFAULT_DEBUG_CHANNEL(ddraw);
21 static LRESULT WINAPI DirectDrawSurface_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
23 void DirectDrawSurface_RegisterClass(void)
26 memset(&wc, 0, sizeof(wc));
27 wc.lpfnWndProc = DirectDrawSurface_WndProc;
28 wc.cbWndExtra = sizeof(IDirectDrawSurfaceImpl*);
29 wc.hCursor = (HCURSOR)IDC_ARROWA;
30 wc.lpszClassName = "WINE_DDRAW";
34 void DirectDrawSurface_UnregisterClass(void)
36 UnregisterClassA("WINE_DDRAW", 0);
39 static LRESULT WINAPI DirectDrawSurface_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
41 IDirectDrawSurfaceImpl *This;
44 This = (IDirectDrawSurfaceImpl *)GetWindowLongA(hwnd, 0);
46 HWND window = This->ddraw_owner->window;
52 case WM_WINDOWPOSCHANGING:
53 case WM_WINDOWPOSCHANGED:
57 /* since we're pretending fullscreen,
58 * let's not pass these on to the app */
59 ret = DefWindowProcA(hwnd, msg, wParam, lParam);
64 case WM_MOUSEACTIVATE:
71 dc = BeginPaint(hwnd, &ps);
72 /* call User_copy_to_screen? */
78 ret = window ? SendMessageA(window, msg, wParam, lParam)
79 : DefWindowProcA(hwnd, msg, wParam, lParam);
82 if (msg == WM_CREATE) {
83 CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam;
84 This = (IDirectDrawSurfaceImpl *)cs->lpCreateParams;
85 SetWindowLongA(hwnd, 0, (LONG)This);
87 ret = DefWindowProcA(hwnd, msg, wParam, lParam);