source: trunk/src/user32/pmframe.cpp@ 1189

Last change on this file since 1189 was 1189, checked in by cbratschi, 26 years ago

subclassed frame, WM_STYLECHANGING fix

File size: 1.9 KB
Line 
1/* $Id: pmframe.cpp,v 1.1 1999-10-08 16:13:08 cbratschi Exp $ */
2/*
3 * Win32 Frame Managment Code for OS/2
4 *
5 * Copyright 1999 by Christoph Bratschi (cbratschi@datacomm.ch)
6 *
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11
12#define INCL_WIN
13#define INCL_GPI
14
15#include <os2.h> /* PM header file */
16#include <os2wrap.h>
17#include <stdlib.h>
18#include "win32type.h"
19#include <misc.h>
20#include <win32wbase.h>
21#include "wprocess.h"
22#include "pmframe.h"
23
24//******************************************************************************
25//Win32 frame message handler
26//******************************************************************************
27MRESULT EXPENTRY Win32FrameProc(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
28{
29 Win32BaseWindow *win32wnd;
30 PFNWP OldFrameProc;
31
32 SetWin32TIB();
33
34 win32wnd = Win32BaseWindow::GetWindowFromFrameHandle(hwnd);
35
36 if(win32wnd == NULL || !win32wnd->getOldFrameProc())
37 {
38 dprintf(("Invalid win32wnd pointer for frame %x!!", hwnd));
39 goto RunDefWndProc;
40 }
41
42 OldFrameProc = (PFNWP)win32wnd->getOldFrameProc();
43
44 switch(msg)
45 {
46 case WM_DESTROY:
47 WinSubclassWindow(hwnd,OldFrameProc);
48 win32wnd->setOldFrameProc(NULL);
49 goto RunDefFrameProc;
50
51 case WM_PAINT:
52 //CB: todo
53
54 default:
55 RestoreOS2TIB();
56 return OldFrameProc(hwnd,msg,mp1,mp2);
57 }
58
59 RestoreOS2TIB();
60 return (MRESULT)FALSE;
61
62RunDefFrameProc:
63 RestoreOS2TIB();
64 return OldFrameProc(hwnd,msg,mp1,mp2);
65
66RunDefWndProc:
67 RestoreOS2TIB();
68 return WinDefWindowProc(hwnd,msg,mp1,mp2);
69}
70
71PVOID FrameSubclassFrameWindow(Win32BaseWindow *win32wnd)
72{
73 return WinSubclassWindow(win32wnd->getOS2FrameWindowHandle(),PFNWP(Win32FrameProc));
74}
75
76VOID FrameSetBorderSize(Win32BaseWindow *win32wnd)
77{
78 //WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_SETBORDERSIZE,(MPARAM)win32wnd->getBorderWidth(),(MPARAM)win32wnd->getBorderHeight());
79}
Note: See TracBrowser for help on using the repository browser.