source: trunk/include/wndproc.h@ 230

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

Dialog window proc override bugfix

File size: 2.1 KB
Line 
1/* $Id: wndproc.h,v 1.5 1999-06-27 21:56:00 sandervl Exp $ */
2
3/*
4 *
5 * Project Odin Software License can be found in LICENSE.TXT
6 *
7 */
8/*
9 * Win32 Window procedure class
10 *
11 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
12 *
13 */
14#ifndef __WNDPROC_H__
15#define __WNDPROC_H__
16
17#ifdef _OS2WIN_H
18#include <winos2def.h>
19#endif
20
21#include "wndclass.h"
22
23//forward decl
24class Win32WindowProc;
25
26//used in COMDLG32.DLL
27Win32WindowProc *SYSTEM CreateWindowProc(WNDPROC pUserCallback);
28LRESULT EXPENTRY_O32 OS2ToWin32Callback(HWND, UINT, WPARAM, LPARAM);
29LRESULT EXPENTRY Win32ToOS2Callback(HWND, UINT, WPARAM, LPARAM);
30
31//Notify parent window of creation/destruction and buttondown messages (if required)
32void NotifyParent(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam);
33
34class Win32WindowProc
35{
36public:
37 Win32WindowProc(WNDPROC pUserCallback);
38 Win32WindowProc(WNDPROC pUserCallback, WNDPROC_O32 pOS2Callback);
39 Win32WindowProc(WNDPROC pUserCallback, DLGTEMPLATE *os2dlg);
40 Win32WindowProc(HINSTANCE hinst, LPCSTR lpszClassName);
41 ~Win32WindowProc();
42
43 static WNDPROC_O32 GetOS2Callback();
44 static WNDPROC GetWin32ToOS2Callback();
45
46 static void DeleteWindow(HWND hwnd);
47 static Win32WindowProc *FindProc(HWND hwnd);
48 static Win32WindowProc *FindProc(HWND hwnd, DWORD threadid);
49 void SetWindowHandle(HWND hwndProc) { hwnd = hwndProc; };
50
51 LRESULT SendMessageA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam);
52
53 static BOOL FindWindowProc(Win32WindowProc *wndproc);
54
55 WNDPROC GetWin32Callback(){ return pCallback; };
56 void SetWin32Callback(WNDPROC pUserCallback)
57 {
58 pCallback = pUserCallback;
59 };
60 int IsWindow() { return fIsWindow; };
61
62Win32WindowClass *GetWindowClass() { return win32class; };
63
64private:
65
66 WNDPROC pCallback;
67 WNDPROC_O32 pOS2Callback;
68 HWND hwnd;
69 DWORD threadid;
70 int fIsWindow;
71 DLGTEMPLATE *os2dlg;
72
73 Win32WindowClass *win32class;
74
75 static Win32WindowProc *windows;
76 Win32WindowProc *next;
77
78 friend LRESULT EXPENTRY_O32 OS2ToWin32Callback(HWND, UINT, WPARAM, LPARAM);
79 friend LRESULT EXPENTRY Win32ToOS2Callback(HWND, UINT, WPARAM, LPARAM);
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.