Changeset 328 for trunk/src/user32/new/win32wnd.h
- Timestamp:
 - Jul 18, 1999, 4:39:35 PM (26 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  trunk/src/user32/new/win32wnd.h (modified) (7 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/src/user32/new/win32wnd.h
r327 r328 1 /* $Id: win32wnd.h,v 1. 9 1999-07-18 13:57:48 cbratschiExp $ */1 /* $Id: win32wnd.h,v 1.10 1999-07-18 14:39:35 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 21 21 class Win32Window; 22 22 23 #define OFFSET_WIN32WNDPTR 024 #define OFFSET_WIN32PM_MAGIC 425 26 #define WIN32PM_MAGIC 0x1234567827 #define CheckMagicDword(a) (a==WIN32PM_MAGIC)23 #define OFFSET_WIN32WNDPTR 0 24 #define OFFSET_WIN32PM_MAGIC 4 25 26 #define WIN32PM_MAGIC 0x12345678 27 #define CheckMagicDword(a) (a==WIN32PM_MAGIC) 28 28 29 29 typedef struct { 30 USHORTcb;31 Win32Window *win32wnd;32 ULONG win32CreateStruct;//or dialog create dword30 USHORT cb; 31 Win32Window *win32wnd; 32 ULONG win32CreateStruct; //or dialog create dword 33 33 } CUSTOMWNDDATA; 34 34 35 35 typedef struct 36 36 { 37 ULONGMsg;38 ULONGwParam;39 ULONGlParam;37 ULONG Msg; 38 ULONG wParam; 39 ULONG lParam; 40 40 } POSTMSG_PACKET; 41 41 42 #define WM_WIN32_POSTMESSAGEA 0x400043 #define WM_WIN32_POSTMESSAGEW 0x400142 #define WM_WIN32_POSTMESSAGEA 0x4000 43 #define WM_WIN32_POSTMESSAGEW 0x4001 44 44 45 45 class Win32Window : private GenericObject, private ChildWindow 46 46 { 47 47 public: 48 DWORDmagic;49 50 Win32Window(DWORD objType);51 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);48 DWORD magic; 49 50 Win32Window(DWORD objType); 51 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode); 52 52 virtual ~Win32Window(); 53 53 54 54 virtual ULONG MsgCreate(HWND hwndOS2, ULONG initParam); 55 ULONG MsgQuit();56 ULONG MsgClose();55 ULONG MsgQuit(); 56 ULONG MsgClose(); 57 57 ULONG MsgDestroy(); 58 ULONG MsgEnable(BOOL fEnable); 59 ULONG MsgShow(BOOL fShow); 60 ULONG MsgMove(ULONG xParent, ULONG yParent); 61 ULONG MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize); 58 ULONG MsgEnable(BOOL fEnable); 59 ULONG MsgShow(BOOL fShow); 60 ULONG MsgMove(ULONG x, ULONG y); 61 ULONG MsgHitTest(ULONG x, ULONG y); 62 ULONG MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize); 62 63 ULONG MsgActivate(BOOL fActivate, HWND hwnd); 63 ULONG MsgSetFocus(HWND hwnd);64 ULONG MsgKillFocus(HWND hwnd);65 ULONG MsgButton(ULONG msg, ULONG x, ULONG y);66 ULONG MsgPaint(ULONG tmp1, ULONG tmp2);67 ULONG MsgEraseBackGround(ULONG hps);68 ULONG MsgSetText(LPSTR lpsz, LONG cch);69 70 virtual LONG SetWindowLongA(int index, ULONG value); 71 virtual ULONG GetWindowLongA(int index);72 virtual WORD SetWindowWord(int index, WORD value);73 virtual 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 (Win32Window *)ChildWindow::GetParent(); };80 void setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };81 64 ULONG MsgSetFocus(HWND hwnd); 65 ULONG MsgKillFocus(HWND hwnd); 66 ULONG MsgButton(ULONG msg, ULONG x, ULONG y); 67 ULONG MsgMouseMove(ULONG keystate, ULONG x, ULONG y); 68 ULONG MsgPaint(ULONG tmp1, ULONG tmp2); 69 ULONG MsgEraseBackGround(ULONG hps); 70 ULONG MsgSetText(LPSTR lpsz, LONG cch); 71 72 virtual LONG SetWindowLongA(int index, ULONG value); 73 virtual ULONG GetWindowLongA(int index); 74 virtual WORD SetWindowWord(int index, WORD value); 75 virtual WORD GetWindowWord(int index); 76 77 DWORD getStyle() { return dwStyle; }; 78 DWORD getExStyle() { return dwExStyle; }; 79 HWND getWindowHandle() { return Win32Hwnd; }; 80 HWND getOS2WindowHandle() { return OS2Hwnd; }; 81 Win32Window *getParent() { return (Win32Window *)ChildWindow::GetParent(); }; 82 void setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); }; 82 83 WNDPROC getWindowProc() { return win32wndproc; }; 83 84 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; }; … … 85 86 void setWindowId(DWORD id) { windowId = id; }; 86 87 87 DWORD getFlags(){ return flags; };88 void setFlags(DWORD newflags){ flags = newflags; };89 90 BOOL SetMenu(ULONG hMenu);91 BOOL ShowWindow(ULONG nCmdShow);92 BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);93 BOOL DestroyWindow();94 HWND SetActiveWindow();95 HWND GetParent();96 HWND SetParent(HWND hwndNewParent);97 BOOL IsChild(HWND hwndParent);98 HWND GetTopWindow();99 BOOL UpdateWindow();100 BOOL IsIconic();88 DWORD getFlags() { return flags; }; 89 void setFlags(DWORD newflags) { flags = newflags; }; 90 91 BOOL SetMenu(ULONG hMenu); 92 BOOL ShowWindow(ULONG nCmdShow); 93 BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags); 94 BOOL DestroyWindow(); 95 HWND SetActiveWindow(); 96 HWND GetParent(); 97 HWND SetParent(HWND hwndNewParent); 98 BOOL IsChild(HWND hwndParent); 99 HWND GetTopWindow(); 100 BOOL UpdateWindow(); 101 BOOL IsIconic(); 101 102 HWND GetWindow(UINT uCmd); 102 BOOL EnableWindow(BOOL fEnable);103 BOOL BringWindowToTop();103 BOOL EnableWindow(BOOL fEnable); 104 BOOL BringWindowToTop(); 104 105 static HWND GetActiveWindow(); 105 106 BOOL IsWindow(); 107 BOOL IsWindowEnabled(); 108 BOOL IsWindowVisible(); 109 110 BOOL GetWindowRect(PRECT pRect); 111 int GetWindowTextLengthA(); 112 int GetWindowTextA(LPSTR lpsz, int cch); 113 BOOL SetWindowTextA(LPCSTR lpsz); 106 BOOL IsWindow(); 107 BOOL IsWindowEnabled(); 108 BOOL IsWindowVisible(); 109 110 BOOL GetWindowRect(PRECT pRect); 111 int GetWindowTextLengthA(); 112 int GetWindowTextA(LPSTR lpsz, int cch); 113 BOOL SetWindowTextA(LPCSTR lpsz); 114 114 115 115 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); … … 125 125 126 126 static Win32Window *GetWindowFromHandle(HWND hwnd); 127 static Win32Window *GetWindowFromOS2Handle(HWND hwnd);128 127 129 128 protected: 130 129 LRESULT SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 131 130 LRESULT SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 132 void Init();133 134 HWNDOS2Hwnd;135 HWNDOS2HwndFrame;136 HWND OS2HwndMenu;137 HWNDWin32Hwnd;138 BOOL isUnicode;139 140 intposx, posy, width, height;141 142 // values normally contained in the standard window words143 ULONG dwExStyle;//GWL_EXSTYLE144 ULONG dwStyle;//GWL_STYLE145 WNDPROC win32wndproc; //GWL_WNDPROC146 ULONG hInstance;//GWL_HINSTANCE131 void Init(); 132 133 HWND OS2Hwnd; 134 HWND OS2HwndFrame; 135 HWND OS2HwndMenu; 136 HWND Win32Hwnd; 137 BOOL isUnicode; 138 139 int posx, posy, width, height; 140 141 // values normally contained in the standard window words 142 ULONG dwExStyle; //GWL_EXSTYLE 143 ULONG dwStyle; //GWL_STYLE 144 WNDPROC win32wndproc; //GWL_WNDPROC 145 ULONG hInstance; //GWL_HINSTANCE 147 146 //Moved in ChildWindow class 148 ///// Win32Window *parent; //GWL_HWNDPARENT149 ULONG windowId;//GWL_ID150 ULONG userData;//GWL_USERDATA147 ///// Win32Window *parent; //GWL_HWNDPARENT 148 ULONG windowId; //GWL_ID 149 ULONG userData; //GWL_USERDATA 151 150 152 151 HWND hwndLinkAfter; 153 152 DWORD flags; 154 155 BOOL isIcon; 156 157 Win32Window *owner; 158 159 char *windowName; 160 ULONG wndNameLength; 161 162 char *windowText; 163 ULONG wndTextLength; 164 165 ULONG *userWindowLong; 166 ULONG nrUserWindowLong; 167 168 RECT rectWindow; 169 RECT rectClient; 153 DWORD lastHitTestVal; //Last value returned by WM_NCHITTEST handler 154 155 BOOL isIcon; 156 157 Win32Window *owner; 158 159 char *windowName; 160 ULONG wndNameLength; 161 162 char *windowText; 163 ULONG wndTextLength; 164 165 ULONG *userWindowLong; 166 ULONG nrUserWindowLong; 167 168 RECT rectWindow; 169 RECT rectClient; 170 170 171 171 Win32WndClass *windowClass; … … 175 175 private: 176 176 #ifndef OS2_INCLUDED 177 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);178 179 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );180 181 LONG SendNCCalcSize(BOOL calcValidRect,177 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom); 178 179 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack ); 180 181 LONG SendNCCalcSize(BOOL calcValidRect, 182 182 RECT *newWindowRect, RECT *oldWindowRect, 183 183 RECT *oldClientRect, WINDOWPOS *winpos, … … 186 186 LRESULT SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam) 187 187 { 188 if(isUnicode)189 return SendInternalMessageW(msg, wParam, lParam);190 elsereturn SendInternalMessageA(msg, wParam, lParam);188 if(isUnicode) 189 return SendInternalMessageW(msg, wParam, lParam); 190 else return SendInternalMessageA(msg, wParam, lParam); 191 191 } 192 192 #endif … … 194 194 195 195 196 #define BUTTON_LEFTDOWN 0 197 #define BUTTON_LEFTUP 1 198 #define BUTTON_LEFTDBLCLICK 2 199 #define BUTTON_RIGHTUP 3 200 #define BUTTON_RIGHTDOWN 4 201 #define BUTTON_RIGHTDBLCLICK 5 196 #define BUTTON_LEFTDOWN 0 197 #define BUTTON_LEFTUP 1 198 #define BUTTON_LEFTDBLCLICK 2 199 #define BUTTON_RIGHTUP 3 200 #define BUTTON_RIGHTDOWN 4 201 #define BUTTON_RIGHTDBLCLICK 5 202 #define BUTTON_MIDDLEUP 6 203 #define BUTTON_MIDDLEDOWN 7 204 #define BUTTON_MIDDLEDBLCLICK 8 205 206 #define WMMOVE_LBUTTON 1 207 #define WMMOVE_MBUTTON 2 208 #define WMMOVE_RBUTTON 4 209 #define WMMOVE_CTRL 8 210 #define WMMOVE_SHIFT 16 211 202 212 203 213 #endif //__cplusplus  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  