source: trunk/src/ddraw/os2DDWindow.cpp@ 3833

Last change on this file since 3833 was 2174, checked in by hugh, 26 years ago

Added ODIn lic header with ID to all files where missing

Cleaned up Surface handling by movefing colorfill and
colorconversion into own files and use functionpointers
setup during creation.

updated makefile to add files

removed inhertiance from IBASE in DDrectangle class

File size: 1.6 KB
Line 
1/* $Id: os2DDWindow.cpp,v 1.4 1999-12-21 01:28:16 hugh Exp $ */
2
3/*
4 * Functions to subclass the games windowproc to be used for
5 * fullscreen switching
6 *
7 * Copyright 1999 Markus Montkowski
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12
13#define INCL_WIN
14#include <os2wrap.h>
15#include <odinwrap.h>
16#include "os2DDWindow.h"
17
18PFNWP pfnOrgClientProc = NULL;
19
20MRESULT EXPENTRY DDOS2WindowProc(HWND hwnd, ULONG ulMsg, MPARAM mp1, MPARAM mp2);
21extern VOID SwitchDisplay(HWND hwnd);
22
23ODINFUNCTION1(BOOL , OS2DDSubClassWindow ,HWND, hwndClient)
24{
25 HWND hwndParent;
26
27 // only allow subclassing once!
28
29 if(NULL==pfnOrgClientProc)
30 {
31 hwndParent = WinQueryWindow(hwndClient,QW_PARENT);
32
33 if(hwndParent!=HWND_DESKTOP)
34 hwndFrame = hwndParent;
35 else
36 hwndFrame = hwndClient;
37
38 pfnOrgClientProc = WinSubclassWindow(hwndFrame,DDOS2WindowProc);
39
40 return TRUE;
41 }
42
43 return FALSE;
44}
45
46
47MRESULT EXPENTRY DDOS2WindowProc(HWND hwnd, ULONG ulMsg, MPARAM mp1, MPARAM mp2)
48{
49 USHORT usFlags;
50
51 switch(ulMsg)
52 {
53 // capture the mouse
54 case WM_ACTIVATE:
55 if(mp1)
56 WinSetCapture(HWND_DESKTOP,hwnd);
57 else
58 WinSetCapture(HWND_DESKTOP,NULLHANDLE);
59 break;
60 case WM_CHAR:
61 // Check for CTRL+SHIFT+F12 to toggle between stretched (FS) / windowd mode
62 usFlags = SHORT1FROMMP(mp1);
63 if(!(usFlags & KC_KEYUP))
64 {
65 if( (usFlags & KC_VIRTUALKEY) && (usFlags & KC_SHIFT) && (usFlags & KC_CTRL))
66 {
67 if(VK_F12 == SHORT2FROMMP(mp2))
68 SwitchDisplay(hwnd);
69 }
70 }
71 break;
72 default:
73 break;
74 }
75
76 return pfnOrgClientProc(hwnd, ulMsg, mp1,mp2);
77}
78
Note: See TracBrowser for help on using the repository browser.