Changeset 650 for trunk/src/user32/new/win32wnd.h
- Timestamp:
 - Aug 23, 1999, 5:34:47 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
r614 r650 1 /* $Id: win32wnd.h,v 1.2 3 1999-08-22 08:30:53 sandervlExp $ */1 /* $Id: win32wnd.h,v 1.24 1999-08-23 15:34:47 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 23 23 class Win32Window; 24 24 25 #define OFFSET_WIN32WNDPTR 026 #define OFFSET_WIN32PM_MAGIC 427 28 #define WIN32PM_MAGIC 0x1234567829 #define CheckMagicDword(a) (a==WIN32PM_MAGIC)25 #define OFFSET_WIN32WNDPTR 0 26 #define OFFSET_WIN32PM_MAGIC 4 27 28 #define WIN32PM_MAGIC 0x12345678 29 #define CheckMagicDword(a) (a==WIN32PM_MAGIC) 30 30 31 31 typedef struct { 32 USHORTcb;33 Win32Window *win32wnd;34 ULONG win32CreateStruct;//or dialog create dword32 USHORT cb; 33 Win32Window *win32wnd; 34 ULONG win32CreateStruct; //or dialog create dword 35 35 } CUSTOMWNDDATA; 36 36 37 37 typedef struct 38 38 { 39 ULONGMsg;40 ULONGwParam;41 ULONGlParam;39 ULONG Msg; 40 ULONG wParam; 41 ULONG lParam; 42 42 } POSTMSG_PACKET; 43 43 44 #define WM_WIN32_POSTMESSAGEA 0x400045 #define WM_WIN32_POSTMESSAGEW 0x400146 47 #define MAX_WINDOW_NAMELENGTH 25644 #define WM_WIN32_POSTMESSAGEA 0x4000 45 #define WM_WIN32_POSTMESSAGEW 0x4001 46 47 #define MAX_WINDOW_NAMELENGTH 256 48 48 49 49 class Win32Window : private GenericObject, private ChildWindow 50 50 { 51 51 public: 52 DWORDmagic;53 54 Win32Window(DWORD objType);55 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);52 DWORD magic; 53 54 Win32Window(DWORD objType); 55 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode); 56 56 virtual ~Win32Window(); 57 57 58 virtual ULONG MsgCreate(HWND hwndOS2, ULONG initParam);59 ULONGMsgQuit();60 ULONGMsgClose();61 ULONGMsgDestroy();62 ULONGMsgEnable(BOOL fEnable);63 ULONGMsgShow(BOOL fShow);64 ULONGMsgMove(ULONG x, ULONG y);65 ULONGMsgHitTest(ULONG x, ULONG y);66 ULONGMsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);67 ULONGMsgActivate(BOOL fActivate, HWND hwnd);68 ULONGMsgSetFocus(HWND hwnd);69 ULONGMsgKillFocus(HWND hwnd);70 ULONGMsgCommand(ULONG cmd, ULONG Id, HWND hwnd);71 ULONGMsgSysCommand(ULONG win32sc, ULONG x, ULONG y);72 ULONGMsgChar(ULONG cmd, ULONG repeatcnt, ULONG scancode, ULONG vkey, ULONG keyflags);73 ULONGMsgButton(ULONG msg, ULONG ncx, ULONG ncy, ULONG clx, ULONG cly);74 ULONGMsgMouseMove(ULONG keystate, ULONG x, ULONG y);75 ULONGMsgPaint(ULONG tmp1, ULONG tmp2);76 ULONG MsgEraseBackGround();77 ULONGMsgSetText(LPSTR lpsz, LONG cch);78 ULONGMsgGetTextLength();79 char *MsgGetText();80 81 virtual LONG SetWindowLongA(int index, ULONG value);82 virtual ULONG GetWindowLongA(int index);83 virtual WORD SetWindowWord(int index, WORD value);84 virtual WORD GetWindowWord(int index);85 86 DWORD getStyle(){ return dwStyle; };87 DWORD getExStyle(){ return dwExStyle; };88 HWND getWindowHandle(){ return Win32Hwnd; };89 HWND getOS2WindowHandle(){ return OS2Hwnd; };90 HWND getOS2FrameWindowHandle(){ return OS2HwndFrame; };91 BOOL isFrameWindow(){ return OS2Hwnd != OS2HwndFrame; };92 Win32Window *getParent() { return (Win32Window *)ChildWindow::GetParent(); };93 voidsetParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };94 WNDPROC getWindowProc(){ return win32wndproc; };95 void setWindowProc(WNDPROC newproc){ win32wndproc = newproc; };96 DWORD getWindowId(){ return windowId; };97 void setWindowId(DWORD id){ windowId = id; };98 ULONG getWindowHeight(){ return rectClient.bottom - rectClient.top; };99 BOOLisChild();100 PRECT getClientRect(){ return &rectClient; };101 PRECT getWindowRect(){ return &rectWindow; };102 103 DWORD getFlags(){ return flags; };104 void setFlags(DWORD newflags){ flags = newflags; };105 106 HACCEL GetAccelTable(){ return (HACCEL) acceltableResource; };107 BOOLSetAccelTable(ULONG hAccel);108 109 HMENU GetMenu(){ return (HMENU) menuResource; };110 BOOLSetMenu(ULONG hMenu);111 112 BOOLSetIcon(HICON hIcon);113 HICON GetIcon(){ return (HICON) iconResource; };114 115 BOOLShowWindow(ULONG nCmdShow);116 BOOLSetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);117 BOOLDestroyWindow();118 HWNDSetActiveWindow();119 HWNDGetParent();120 HWNDSetParent(HWND hwndNewParent);121 BOOLIsChild(HWND hwndParent);122 HWNDGetTopWindow();123 BOOLUpdateWindow();124 BOOLIsIconic();125 HWNDGetWindow(UINT uCmd);126 BOOLEnableWindow(BOOL fEnable);127 BOOLCloseWindow();128 static HWND GetActiveWindow();129 BOOLIsWindow();130 BOOLIsWindowEnabled();131 BOOLIsWindowVisible();132 BOOLIsUnicode() { return isUnicode; };133 134 BOOLGetWindowRect(PRECT pRect);135 intGetWindowTextLengthA();136 intGetWindowTextA(LPSTR lpsz, int cch);137 BOOLSetWindowTextA(LPCSTR lpsz);138 139 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);140 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);141 BOOL PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);142 BOOL PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);143 LRESULT DefWindowProcA(UINT msg, WPARAM wParam, LPARAM lParam);144 LRESULT DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam);145 146 voidNotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);58 virtual ULONG MsgCreate(HWND hwndOS2, ULONG initParam); 59 ULONG MsgQuit(); 60 ULONG MsgClose(); 61 ULONG MsgDestroy(); 62 ULONG MsgEnable(BOOL fEnable); 63 ULONG MsgShow(BOOL fShow); 64 ULONG MsgMove(ULONG x, ULONG y); 65 ULONG MsgHitTest(ULONG x, ULONG y); 66 ULONG MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize); 67 ULONG MsgActivate(BOOL fActivate, HWND hwnd); 68 ULONG MsgSetFocus(HWND hwnd); 69 ULONG MsgKillFocus(HWND hwnd); 70 ULONG MsgCommand(ULONG cmd, ULONG Id, HWND hwnd); 71 ULONG MsgSysCommand(ULONG win32sc, ULONG x, ULONG y); 72 ULONG MsgChar(ULONG cmd, ULONG repeatcnt, ULONG scancode, ULONG vkey, ULONG keyflags); 73 ULONG MsgButton(ULONG msg, ULONG ncx, ULONG ncy, ULONG clx, ULONG cly); 74 ULONG MsgMouseMove(ULONG keystate, ULONG x, ULONG y); 75 ULONG MsgPaint(ULONG tmp1, ULONG tmp2); 76 ULONG MsgEraseBackGround(HDC hdc); 77 ULONG MsgSetText(LPSTR lpsz, LONG cch); 78 ULONG MsgGetTextLength(); 79 char *MsgGetText(); 80 81 virtual LONG SetWindowLongA(int index, ULONG value); 82 virtual ULONG GetWindowLongA(int index); 83 virtual WORD SetWindowWord(int index, WORD value); 84 virtual WORD GetWindowWord(int index); 85 86 DWORD getStyle() { return dwStyle; }; 87 DWORD getExStyle() { return dwExStyle; }; 88 HWND getWindowHandle() { return Win32Hwnd; }; 89 HWND getOS2WindowHandle() { return OS2Hwnd; }; 90 HWND getOS2FrameWindowHandle() { return OS2HwndFrame; }; 91 BOOL isFrameWindow() { return OS2Hwnd != OS2HwndFrame; }; 92 Win32Window *getParent() { return (Win32Window *)ChildWindow::GetParent(); }; 93 void setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); }; 94 WNDPROC getWindowProc() { return win32wndproc; }; 95 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; }; 96 DWORD getWindowId() { return windowId; }; 97 void setWindowId(DWORD id) { windowId = id; }; 98 ULONG getWindowHeight() { return rectClient.bottom - rectClient.top; }; 99 BOOL isChild(); 100 PRECT getClientRect() { return &rectClient; }; 101 PRECT getWindowRect() { return &rectWindow; }; 102 103 DWORD getFlags() { return flags; }; 104 void setFlags(DWORD newflags) { flags = newflags; }; 105 106 HACCEL GetAccelTable() { return (HACCEL) acceltableResource; }; 107 BOOL SetAccelTable(ULONG hAccel); 108 109 HMENU GetMenu() { return (HMENU) menuResource; }; 110 BOOL SetMenu(ULONG hMenu); 111 112 BOOL SetIcon(HICON hIcon); 113 HICON GetIcon() { return (HICON) iconResource; }; 114 115 BOOL ShowWindow(ULONG nCmdShow); 116 BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags); 117 BOOL DestroyWindow(); 118 HWND SetActiveWindow(); 119 HWND GetParent(); 120 HWND SetParent(HWND hwndNewParent); 121 BOOL IsChild(HWND hwndParent); 122 HWND GetTopWindow(); 123 BOOL UpdateWindow(); 124 BOOL IsIconic(); 125 HWND GetWindow(UINT uCmd); 126 BOOL EnableWindow(BOOL fEnable); 127 BOOL CloseWindow(); 128 static HWND GetActiveWindow(); 129 BOOL IsWindow(); 130 BOOL IsWindowEnabled(); 131 BOOL IsWindowVisible(); 132 BOOL IsUnicode() { return isUnicode; }; 133 134 BOOL GetWindowRect(PRECT pRect); 135 int GetWindowTextLengthA(); 136 int GetWindowTextA(LPSTR lpsz, int cch); 137 BOOL SetWindowTextA(LPCSTR lpsz); 138 139 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 140 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 141 BOOL PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 142 BOOL PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 143 LRESULT DefWindowProcA(UINT msg, WPARAM wParam, LPARAM lParam); 144 LRESULT DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam); 145 146 void NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam); 147 147 148 148 Win32WndClass *getClass() { return windowClass; }; 149 149 150 static HWND Win32ToOS2Handle(HWND hwnd)150 static HWND Win32ToOS2Handle(HWND hwnd) 151 151 { 152 152 Win32Window *window = GetWindowFromHandle(hwnd); 153 153 154 154 if(window) { 155 return window->getOS2WindowHandle();155 return window->getOS2WindowHandle(); 156 156 } 157 else return hwnd;//OS/2 window handle157 else return hwnd; //OS/2 window handle 158 158 } 159 159 160 static HWND OS2ToWin32Handle(HWND hwnd)160 static HWND OS2ToWin32Handle(HWND hwnd) 161 161 { 162 162 Win32Window *window = GetWindowFromOS2Handle(hwnd); 163 163 164 164 if(window) { 165 return window->getWindowHandle();165 return window->getWindowHandle(); 166 166 } 167 else return hwnd;//OS/2 window handle167 else return hwnd; //OS/2 window handle 168 168 } 169 169 … … 172 172 173 173 protected: 174 LRESULT SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);175 LRESULT SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);176 voidInit();177 178 HWNDOS2Hwnd;179 HWNDOS2HwndFrame;180 HWNDOS2HwndMenu;181 HWNDWin32Hwnd;182 BOOLisUnicode;183 184 intposx, posy, width, height;185 186 // values normally contained in the standard window words187 ULONG dwExStyle;//GWL_EXSTYLE188 ULONG dwStyle;//GWL_STYLE189 WNDPROC win32wndproc;//GWL_WNDPROC190 ULONG hInstance;//GWL_HINSTANCE174 LRESULT SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 175 LRESULT SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 176 void Init(); 177 178 HWND OS2Hwnd; 179 HWND OS2HwndFrame; 180 HWND OS2HwndMenu; 181 HWND Win32Hwnd; 182 BOOL isUnicode; 183 184 int posx, posy, width, height; 185 186 // values normally contained in the standard window words 187 ULONG dwExStyle; //GWL_EXSTYLE 188 ULONG dwStyle; //GWL_STYLE 189 WNDPROC win32wndproc; //GWL_WNDPROC 190 ULONG hInstance; //GWL_HINSTANCE 191 191 //Moved in ChildWindow class 192 ///// Win32Window *parent;//GWL_HWNDPARENT193 ULONG windowId;//GWL_ID194 ULONG userData;//GWL_USERDATA195 196 HWNDhwndLinkAfter;197 DWORDflags;198 DWORD lastHitTestVal;//Last value returned by WM_NCHITTEST handler199 200 BOOLisIcon;201 BOOLfCreated;202 BOOLfFirstShow;203 204 Win32Window *owner; 192 ///// Win32Window *parent; //GWL_HWNDPARENT 193 ULONG windowId; //GWL_ID 194 ULONG userData; //GWL_USERDATA 195 196 HWND hwndLinkAfter; 197 DWORD flags; 198 DWORD lastHitTestVal; //Last value returned by WM_NCHITTEST handler 199 200 BOOL isIcon; 201 BOOL fCreated; 202 BOOL fFirstShow; 203 204 Win32Window *owner; 205 205 206 206 Win32Resource *acceltableResource; … … 208 208 Win32Resource *iconResource; 209 209 210 charwindowNameA[MAX_WINDOW_NAMELENGTH];211 WCHARwindowNameW[MAX_WINDOW_NAMELENGTH];212 ULONGwndNameLength;213 214 ULONG *userWindowLong;215 ULONGnrUserWindowLong;216 217 RECTrectWindow;218 RECTrectClient;210 char windowNameA[MAX_WINDOW_NAMELENGTH]; 211 WCHAR windowNameW[MAX_WINDOW_NAMELENGTH]; 212 ULONG wndNameLength; 213 214 ULONG *userWindowLong; 215 ULONG nrUserWindowLong; 216 217 RECT rectWindow; 218 RECT rectClient; 219 219 220 220 Win32WndClass *windowClass; … … 224 224 private: 225 225 #ifndef OS2_INCLUDED 226 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);227 228 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );229 230 LONG SendNCCalcSize(BOOL calcValidRect,231 RECT *newWindowRect, RECT *oldWindowRect,232 RECT *oldClientRect, WINDOWPOS *winpos,233 RECT *newClientRect );226 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom); 227 228 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack ); 229 230 LONG SendNCCalcSize(BOOL calcValidRect, 231 RECT *newWindowRect, RECT *oldWindowRect, 232 RECT *oldClientRect, WINDOWPOS *winpos, 233 RECT *newClientRect ); 234 234 235 235 LRESULT SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam) 236 236 { 237 if(isUnicode)238 return SendInternalMessageW(msg, wParam, lParam);239 elsereturn SendInternalMessageA(msg, wParam, lParam);237 if(isUnicode) 238 return SendInternalMessageW(msg, wParam, lParam); 239 else return SendInternalMessageA(msg, wParam, lParam); 240 240 } 241 241 #endif … … 243 243 244 244 245 #define BUTTON_LEFTDOWN 0246 #define BUTTON_LEFTUP 1247 #define BUTTON_LEFTDBLCLICK 2248 #define BUTTON_RIGHTUP 3249 #define BUTTON_RIGHTDOWN 4250 #define BUTTON_RIGHTDBLCLICK 5251 #define BUTTON_MIDDLEUP 6252 #define BUTTON_MIDDLEDOWN 7253 #define BUTTON_MIDDLEDBLCLICK 8254 255 #define WMMOVE_LBUTTON 1256 #define WMMOVE_MBUTTON 2257 #define WMMOVE_RBUTTON 4258 #define WMMOVE_CTRL 8259 #define WMMOVE_SHIFT 16260 261 262 #define CMD_MENU 1263 #define CMD_CONTROL 2264 #define CMD_ACCELERATOR 3265 266 #define WIN32SC_SIZE 0xf000267 #define WIN32SC_MOVE 0xf010245 #define BUTTON_LEFTDOWN 0 246 #define BUTTON_LEFTUP 1 247 #define BUTTON_LEFTDBLCLICK 2 248 #define BUTTON_RIGHTUP 3 249 #define BUTTON_RIGHTDOWN 4 250 #define BUTTON_RIGHTDBLCLICK 5 251 #define BUTTON_MIDDLEUP 6 252 #define BUTTON_MIDDLEDOWN 7 253 #define BUTTON_MIDDLEDBLCLICK 8 254 255 #define WMMOVE_LBUTTON 1 256 #define WMMOVE_MBUTTON 2 257 #define WMMOVE_RBUTTON 4 258 #define WMMOVE_CTRL 8 259 #define WMMOVE_SHIFT 16 260 261 262 #define CMD_MENU 1 263 #define CMD_CONTROL 2 264 #define CMD_ACCELERATOR 3 265 266 #define WIN32SC_SIZE 0xf000 267 #define WIN32SC_MOVE 0xf010 268 268 #define WIN32SC_MINIMIZE 0xf020 269 269 #define WIN32SC_MAXIMIZE 0xf030 270 270 #define WIN32SC_NEXTWINDOW 0xf040 271 271 #define WIN32SC_PREVWINDOW 0xf050 272 #define WIN32SC_CLOSE 0xf060272 #define WIN32SC_CLOSE 0xf060 273 273 #define WIN32SC_VSCROLL 0xf070 274 274 #define WIN32SC_HSCROLL 0xf080 … … 279 279 #define WIN32SC_TASKLIST 0xf130 280 280 #define WIN32SC_SCREENSAVE 0xf140 281 #define WIN32SC_HOTKEY 0xf150282 283 #define KEY_ALTDOWN 1284 #define KEY_PREVDOWN 2285 #define KEY_UP 4286 #define KEY_DEADKEY 8281 #define WIN32SC_HOTKEY 0xf150 282 283 #define KEY_ALTDOWN 1 284 #define KEY_PREVDOWN 2 285 #define KEY_UP 4 286 #define KEY_DEADKEY 8 287 287 288 288 #endif //__cplusplus  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  