source: trunk/src/user32/new/win32wnd.h@ 309

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

Send/PostMessage changes

File size: 4.1 KB
Line 
1/* $Id: win32wnd.h,v 1.3 1999-07-15 18:03:03 sandervl Exp $ */
2/*
3 * Win32 Window Code for OS/2
4 *
5 *
6 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#ifndef __WIN32WND_H__
13#define __WIN32WND_H__
14
15#ifdef __cplusplus
16
17#include <win32class.h>
18#include <gen_object.h>
19
20class Win32Window;
21
22#define WIN2OS2HWND(a) (Win32Window*)(a^a)
23#define OS22WINHWND(a) (a^a)
24
25#define OFFSET_WIN32WNDPTR 0
26#define OFFSET_WIN32PM_MAGIC 4
27
28#define WIN32PM_MAGIC 0x12345678
29
30typedef struct {
31 USHORT cb;
32 Win32Window *win32wnd;
33 ULONG win32CreateStruct; //or dialog create dword
34} CUSTOMWNDDATA;
35
36typedef struct
37{
38 ULONG Msg;
39 ULONG wParam;
40 ULONG lParam;
41} POSTMSG_PACKET;
42
43#define WM_WIN32_POSTMESSAGEA 0x4000
44#define WM_WIN32_POSTMESSAGEW 0x4001
45
46class Win32Window : public GenericObject
47{
48public:
49 DWORD magic;
50
51 Win32Window(DWORD objType);
52 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
53virtual ~Win32Window();
54
55virtual ULONG MsgCreate(HWND hwndOS2, ULONG initParam);
56 ULONG MsgQuit();
57 ULONG MsgClose();
58 ULONG MsgDestroy();
59 ULONG MsgEnable(BOOL fEnable);
60 ULONG MsgShow(BOOL fShow);
61 ULONG MsgMove(ULONG xScreen, ULONG yScreen, ULONG xParent, ULONG yParent);
62 ULONG MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
63 ULONG MsgActivate(BOOL fActivate, HWND hwnd);
64 ULONG MsgSetFocus(HWND hwnd);
65 ULONG MsgKillFocus(HWND hwnd);
66 ULONG MsgButton(ULONG msg, ULONG x, ULONG y);
67 ULONG MsgPaint(ULONG tmp1, ULONG tmp2);
68 ULONG MsgEraseBackGround(ULONG hps);
69
70virtual LONG SetWindowLongA(int index, ULONG value);
71virtual ULONG GetWindowLongA(int index);
72virtual WORD SetWindowWord(int index, WORD value);
73virtual WORD GetWindowWord(int index);
74
75 DWORD getStyle() { return dwStyle; };
76 DWORD getExStyle() { return dwExStyle; };
77 HWND getWindowHandle() { return Win32Hwnd; };
78 HWND getOS2WindowHandle() { return OS2Hwnd; };
79 Win32Window *getParent() { return parent; };
80 void setParent(Win32Window *pwindow) { parent = pwindow; };
81 WNDPROC getWindowProc() { return win32wndproc; };
82 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; };
83 DWORD getWindowId() { return windowId; };
84 void setWindowId(DWORD id) { windowId = id; };
85
86 DWORD getFlags() { return flags; };
87 void setFlags(DWORD newflags) { flags = newflags; };
88
89 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
90 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
91 LRESULT PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
92 LRESULT PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
93 LRESULT DefWindowProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
94 LRESULT DefWindowProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
95
96 void NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);
97
98Win32WndClass *getClass() { return windowClass; };
99
100protected:
101 void Init();
102
103
104 HWND OS2Hwnd;
105 HWND Win32Hwnd;
106 BOOL isUnicode;
107
108 int posx, posy, width, height;
109
110 // values normally contained in the standard window words
111 ULONG dwExStyle; //GWL_EXSTYLE
112 ULONG dwStyle; //GWL_STYLE
113 WNDPROC win32wndproc; //GWL_WNDPROC
114 ULONG hInstance; //GWL_HINSTANCE
115 Win32Window *parent; //GWL_HWNDPARENT
116 ULONG windowId; //GWL_ID
117 ULONG userData; //GWL_USERDATA
118
119 HWND hwndLinkAfter;
120 DWORD flags;
121
122 Win32Window *owner;
123
124 char *windowName;
125 ULONG wndNameLength;
126
127 char *windowText;
128 ULONG wndTextLength;
129
130 ULONG *userWindowLong;
131 ULONG nrUserWindowLong;
132
133Win32WndClass *windowClass;
134
135static GenericObject *windows;
136
137private:
138 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
139
140 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
141};
142
143
144#define BUTTON_LEFTDOWN 0
145#define BUTTON_LEFTUP 1
146#define BUTTON_LEFTDBLCLICK 2
147#define BUTTON_RIGHTUP 3
148#define BUTTON_RIGHTDOWN 4
149#define BUTTON_RIGHTDBLCLICK 5
150
151#endif //__cplusplus
152
153#endif //__WIN32WND_H__
Note: See TracBrowser for help on using the repository browser.