Changeset 300 for trunk/src/user32/new/win32wnd.h
- Timestamp:
- Jul 14, 1999, 10:35:38 AM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/new/win32wnd.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/win32wnd.h
r4 r300 1 /* $Id: win32wnd.h,v 1.1 1999-05-24 20:20:05 ktk Exp $ */ 2 1 /* $Id: win32wnd.h,v 1.2 1999-07-14 08:35:37 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 */ 3 12 #ifndef __WIN32WND_H__ 4 13 #define __WIN32WND_H__ … … 6 15 #ifdef __cplusplus 7 16 8 #include "win32class.h" 17 #include <win32class.h> 18 #include <gen_object.h> 9 19 10 #define WIN2OS2HWND(a) (a^a) 20 class Win32Window; 21 22 #define WIN2OS2HWND(a) (Win32Window*)(a^a) 11 23 #define OS22WINHWND(a) (a^a) 12 24 13 //Win32 window message handler 14 typedef LRESULT (* WIN32API WINWNDPROC) ( HWND, UINT, WPARAM, LPARAM ); 25 #define OFFSET_WIN32WNDPTR 0 26 #define OFFSET_WIN32PM_MAGIC 4 15 27 16 class Win32Window 28 #define WIN32PM_MAGIC 0x12345678 29 30 typedef struct { 31 USHORT cb; 32 Win32Window *win32wnd; 33 ULONG win32CreateStruct; //or dialog create dword 34 } CUSTOMWNDDATA; 35 36 class Win32Window : public GenericObject 17 37 { 18 38 public: 19 Win32Window(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 39 DWORD magic; 40 41 Win32Window(DWORD objType); 42 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode); 20 43 virtual ~Win32Window(); 21 44 22 MRESULT ProcessMessage(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 45 virtual ULONG MsgCreate(HWND hwndOS2, ULONG initParam); 46 ULONG MsgQuit(); 47 ULONG MsgClose(); 48 ULONG MsgDestroy(); 49 ULONG MsgEnable(BOOL fEnable); 50 ULONG MsgShow(BOOL fShow); 51 ULONG MsgMove(ULONG xScreen, ULONG yScreen, ULONG xParent, ULONG yParent); 52 ULONG MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize); 53 ULONG MsgActivate(BOOL fActivate, HWND hwnd); 54 ULONG MsgSetFocus(HWND hwnd); 55 ULONG MsgKillFocus(HWND hwnd); 56 ULONG MsgButton(ULONG msg, ULONG x, ULONG y); 57 ULONG MsgPaint(ULONG tmp1, ULONG tmp2); 58 ULONG MsgEraseBackGround(ULONG hps); 23 59 24 virtual BOOL SetWindowLong(int index, ULONG value); 25 virtual ULONG GetWindowLong(int index); 60 virtual LONG SetWindowLongA(int index, ULONG value); 61 virtual ULONG GetWindowLongA(int index); 62 virtual WORD SetWindowWord(int index, WORD value); 63 virtual WORD GetWindowWord(int index); 26 64 27 BOOL PostMessageA(HWND hwnd, ULONG msg, WPARAM wParam, LPARAM lParam); 28 BOOL PostMessageW(HWND hwnd, ULONG msg, WPARAM wParam, LPARAM lParam); 65 DWORD getStyle() { return dwStyle; }; 66 DWORD getExStyle() { return dwExStyle; }; 67 HWND getWindowHandle() { return Win32Hwnd; }; 68 HWND getOS2WindowHandle() { return OS2Hwnd; }; 69 Win32Window *getParent() { return parent; }; 70 void setParent(Win32Window *pwindow) { parent = pwindow; }; 71 WNDPROC getWindowProc() { return win32wndproc; }; 72 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; }; 73 DWORD getWindowId() { return windowId; }; 74 void setWindowId(DWORD id) { windowId = id; }; 75 76 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 77 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 78 LRESULT DefWindowProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 79 LRESULT DefWindowProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 80 81 void NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam); 29 82 30 83 Win32WndClass *getClass() { return windowClass; }; 31 84 32 85 protected: 86 void Init(); 87 88 33 89 HWND OS2Hwnd; 34 90 HWND Win32Hwnd; … … 38 94 39 95 // values normally contained in the standard window words 40 ULONG ExtendedWindowStyle; //GWL_EXSTYLE 41 ULONG WindowStyle; //GWL_STYLE 42 //ptr to WINWNDPROC in windowClass 43 WINWNDPROC *win32wndproc; //GWL_WNDPROC 96 ULONG dwExStyle; //GWL_EXSTYLE 97 ULONG dwStyle; //GWL_STYLE 98 WNDPROC win32wndproc; //GWL_WNDPROC 44 99 ULONG hInstance; //GWL_HINSTANCE 45 HWND hwndParent;//GWL_HWNDPARENT100 Win32Window *parent; //GWL_HWNDPARENT 46 101 ULONG windowId; //GWL_ID 47 102 ULONG userData; //GWL_USERDATA 103 104 HWND hwndLinkAfter; 105 DWORD flags; 106 107 Win32Window *owner; 108 109 char *windowName; 110 ULONG wndNameLength; 48 111 49 112 char *windowText; 50 113 ULONG wndTextLength; 51 114 52 ULONG * UserWindowLong;115 ULONG *userWindowLong; 53 116 ULONG nrUserWindowLong; 54 117 55 118 Win32WndClass *windowClass; 56 119 57 Win32Window *parent; 58 Win32Window *child; 59 Win32Window *nextchild; 120 static GenericObject *windows; 60 121 61 122 private: 123 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom); 124 125 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack ); 126 }; 62 127 63 128 64 }; 65 129 #define BUTTON_LEFTDOWN 0 130 #define BUTTON_LEFTUP 1 131 #define BUTTON_LEFTDBLCLICK 2 132 #define BUTTON_RIGHTUP 3 133 #define BUTTON_RIGHTDOWN 4 134 #define BUTTON_RIGHTDBLCLICK 5 66 135 67 136 #endif //__cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.
