source: trunk/src/user32/win32wnd.cpp@ 2084

Last change on this file since 2084 was 2084, checked in by sandervl, 26 years ago

sendmessage + hook updates + misc fixes

File size: 5.4 KB
Line 
1/* $Id: win32wnd.cpp,v 1.3 1999-12-16 00:11:48 sandervl Exp $ */
2/*
3 * Win32 Window Class for OS/2
4 *
5 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
6 * Copyright 1999 Daniela Engert (dani@ngrt.de)
7 *
8 * Parts based on Wine (windows\mdi.c) (990815)
9 *
10 * Copyright 1994, Bob Amstadt
11 * 1995,1996 Alex Korobka
12 *
13 * Project Odin Software License can be found in LICENSE.TXT
14 *
15 */
16#include <os2win.h>
17#include <win.h>
18#include <stdlib.h>
19#include <string.h>
20#include <stdarg.h>
21#include <assert.h>
22#include <misc.h>
23#include <win32wnd.h>
24#include <heapstring.h>
25#include <spy.h>
26#include "wndmsg.h"
27#include <oslibwin.h>
28#include <oslibutil.h>
29#include <oslibgdi.h>
30#include <oslibres.h>
31#include "oslibdos.h"
32#include <winres.h>
33#include "syscolor.h"
34#include "win32wndhandle.h"
35
36
37//******************************************************************************
38//******************************************************************************
39Win32Window::Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode)
40 : Win32BaseWindow(lpCreateStructA, classAtom, isUnicode)
41{
42}
43//******************************************************************************
44//******************************************************************************
45Win32Window::~Win32Window()
46{
47}
48//******************************************************************************
49//******************************************************************************
50LRESULT Win32Window::DefFrameProcA(HWND hwndMDIClient, UINT Msg, WPARAM wParam, LPARAM lParam)
51{
52 Win32Window *window = NULL;
53
54 if(hwndMDIClient)
55 window = (Win32Window *)GetWindowFromHandle(hwndMDIClient);
56
57 if(window)
58 {
59 switch(Msg)
60 {
61 case WM_NCACTIVATE:
62 window->SendMessageA(Msg, wParam, lParam);
63 break;
64
65#if 0
66 case WM_COMMAND:
67 ci = (MDICLIENTINFO*)wndPtr->wExtra;
68
69 /* check for possible syscommands for maximized MDI child */
70 WIN_ReleaseWndPtr(wndPtr);
71
72 if( ci && (
73 wParam < ci->idFirstChild ||
74 wParam >= ci->idFirstChild + ci->nActiveChildren
75 )){
76 if( (wParam - 0xF000) & 0xF00F ) break;
77 switch( wParam )
78 {
79 case SC_SIZE:
80 case SC_MOVE:
81 case SC_MINIMIZE:
82 case SC_MAXIMIZE:
83 case SC_NEXTWINDOW:
84 case SC_PREVWINDOW:
85 case SC_CLOSE:
86 case SC_RESTORE:
87 if( ci->hwndChildMaximized )
88 return SendMessage16( ci->hwndChildMaximized, WM_SYSCOMMAND,
89 wParam, lParam);
90 }
91 }
92 else
93 {
94 wndPtr = WIN_FindWndPtr(hwndMDIClient);
95 childHwnd = MDI_GetChildByID(wndPtr,wParam );
96 WIN_ReleaseWndPtr(wndPtr);
97
98 if( childHwnd )
99 SendMessage16(hwndMDIClient, WM_MDIACTIVATE,
100 (WPARAM16)childHwnd , 0L);
101 }
102 break;
103#endif
104
105 case WM_SETFOCUS:
106 SetFocus(hwndMDIClient);
107 break;
108
109 case WM_SIZE:
110 MoveWindow(hwndMDIClient, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
111 break;
112
113#if 0
114 case WM_NEXTMENU:
115 ci = (MDICLIENTINFO*)wndPtr->wExtra;
116
117 if( !(wndPtr->parent->dwStyle & WS_MINIMIZE)
118 && ci->hwndActiveChild && !ci->hwndChildMaximized )
119 {
120 /* control menu is between the frame system menu and
121 * the first entry of menu bar */
122
123 if( (wParam == VK_LEFT &&
124 wndPtr->parent->wIDmenu == LOWORD(lParam)) ||
125 (wParam == VK_RIGHT &&
126 GetSubMenu16(wndPtr->parent->hSysMenu, 0) == LOWORD(lParam)) )
127 {
128 LRESULT retvalue;
129 wndPtr = WIN_FindWndPtr(ci->hwndActiveChild);
130 retvalue = MAKELONG( GetSubMenu16(wndPtr->hSysMenu, 0),
131 ci->hwndActiveChild);
132 return retvalue;
133 }
134 }
135 break;
136#endif
137 }
138 }
139 return DefWindowProcA(Msg, wParam, lParam);
140}
141//******************************************************************************
142//******************************************************************************
143LRESULT Win32Window::DefFrameProcW(HWND hwndMDIClient, UINT Msg, WPARAM wParam, LPARAM lParam)
144{
145 Win32Window *window = NULL;
146
147 if(hwndMDIClient)
148 window = (Win32Window *)GetWindowFromHandle(hwndMDIClient);
149
150 if(window)
151 {
152 switch(Msg)
153 {
154 case WM_NCACTIVATE:
155 window->SendMessageW(Msg, wParam, lParam);
156 break;
157
158 case WM_SETTEXT:
159 {
160 LPSTR txt = HEAP_strdupWtoA(GetProcessHeap(),0,(LPWSTR)lParam);
161 LRESULT ret = DefFrameProcA(hwndMDIClient, Msg, wParam, (DWORD)txt );
162 HeapFree(GetProcessHeap(),0,txt);
163 return ret;
164 }
165 case WM_NEXTMENU:
166 case WM_SETFOCUS:
167 case WM_SIZE:
168 return DefFrameProcA(hwndMDIClient, Msg, wParam, lParam );
169 }
170 }
171 return DefWindowProcW(Msg, wParam, lParam);
172}
173//******************************************************************************
174//******************************************************************************
Note: See TracBrowser for help on using the repository browser.