Changeset 19440
- Timestamp:
- Jul 18, 2002, 11:54:59 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/src/user32/pmwindow.cpp ¶
r19286 r19440 1 /* $Id: pmwindow.cpp,v 1.18 0 2002-06-20 14:25:49 sandervlExp $ */1 /* $Id: pmwindow.cpp,v 1.181 2002-07-18 21:54:59 achimha Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 99 99 100 100 //****************************************************************************** 101 //Initialize PM; create hab, message queue and register special Win32 window classes 101 // Initialize PM; create hab, message queue and register special Win32 window classes 102 // 103 // This is called from the initterm, so we call it only once for each process. 104 // We make sure PM is up and running for our purposes and init the existing 105 // thread 0. 102 106 //****************************************************************************** 103 107 BOOL InitPM() … … 136 140 } 137 141 } 142 143 // store our HAB and HMQ in the TEB - we need it quite often 144 // and they don't map 1:1 to Windows entities 138 145 SetThreadHAB(hab); 139 146 dprintf(("InitPM: hmq = %x", hmq)); … … 176 183 dprintf(("WC_FRAME style %x", FrameClassInfo.flClassStyle)); 177 184 185 // this is our OS/2 window class for frame windows 178 186 if(!WinRegisterClass( /* Register window class */ 179 187 hab, /* Anchor block handle */ … … 187 195 } 188 196 197 // get the screen dimensions and store them 189 198 WinQueryWindowRect(HWND_DESKTOP, &desktopRectl); 190 199 ScreenWidth = desktopRectl.xRight; … … 196 205 NULL, NULL, NULL}; 197 206 198 /* create memory device context */207 /* create memory device context - it's temporary to query some information */ 199 208 hdc = DevOpenDC(hab, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&dop, NULLHANDLE); 200 209 210 // check if we have the OS/2 Look and Feel enabled 201 211 fOS2Look = PROFILE_GetOdinIniBool(ODINSYSTEM_SECTION, "OS2Look", FALSE); 202 212 if(fOS2Look) … … 207 217 SYSCOLOR_Init(FALSE); //use OS/2 colors 208 218 219 // query the name of the display driver resource DLL to load 220 // some standard bitmaps from it 209 221 DspInitSystemDriverName(szDisplay, sizeof(szDisplay)); 210 222 DosQueryModuleHandle(szDisplay, &hModDisplay); … … 215 227 } 216 228 229 // find out which colordepth we're running 217 230 DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, (PLONG)&ScreenBitsPerPel); 218 231 … … 228 241 //menu.cpp 229 242 BOOL MENU_Init(); 243 //****************************************************************************** 244 // AH TODO 2002-07-18 245 // Note: this looks a lot like unnecessary code duplication. We should call this 246 // function from InitPM... 230 247 //****************************************************************************** 231 248 void WIN32API SetWindowAppearance(int fLooks) … … 412 429 } 413 430 //****************************************************************************** 414 //Win32 window message handler 431 // Win32 window message handler 432 // The PM window procedure for our client window class (non frame) 415 433 //****************************************************************************** 416 434 MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) … … 423 441 OSLIBPOINT point, ClientPoint; 424 442 425 // Restore our FS selector443 // restore our FS selector 426 444 SetWin32TIB(); 427 445 428 // NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- BEGIN446 // BEGIN NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- BEGIN 429 447 teb = GetThreadTEB(); 430 448 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); … … 432 450 //// dprintf(("window %x msg %x", (win32wnd) ? win32wnd->getWindowHandle() : 0, msg)); 433 451 452 // do some sanity checking here: 453 // - we need to have a TEB handle 454 // - unless this is WM_CREATE (the very first message), there has to be 455 // a USER32 window object for this window handle 434 456 if(!teb || (msg != WM_CREATE && win32wnd == NULL)) { 435 457 dprintf(("OS2: Invalid win32wnd pointer for window %x msg %x", hwnd, msg)); … … 440 462 //// } 441 463 464 // check if the message state counter in the TEB is odd 465 // this means that DispatchMessage has been called 442 466 if((teb->o.odin.msgstate & 1) == 0) 443 {//message that was sent directly to our window proc handler; translate it here 467 { 468 // message that was sent directly to our window proc handler; translate it here 444 469 QMSG qmsg; 445 470 … … 462 487 teb->o.odin.msgstate++; 463 488 } 464 // NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- END489 // END NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- END 465 490 466 491 if(msg >= WIN32APP_POSTMSG) { … … 976 1001 SetWin32TIB(); 977 1002 978 // NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- BEGIN1003 // BEGIN NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- BEGIN 979 1004 teb = GetThreadTEB(); 980 1005 win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd); 981 1006 1007 // do some sanity checking here: 1008 // - we need to have a TEB handle 1009 // - unless this is WM_CREATE (the very first message), there has to be 1010 // a USER32 window object for this window handle 982 1011 if(!teb || (msg != WM_CREATE && win32wnd == NULL)) { 983 1012 dprintf(("PMFRAME: Invalid win32wnd pointer for window %x msg %x", hwnd, msg)); … … 988 1017 //// } 989 1018 1019 // check if the message state counter in the TEB is odd 990 1020 if((teb->o.odin.msgstate & 1) == 0) 991 1021 {//message that was sent directly to our window proc handler; translate it here … … 1010 1040 teb->o.odin.msgstate++; 1011 1041 } 1012 // NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- END1042 // END NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- END 1013 1043 1014 1044 switch( msg )
Note:
See TracChangeset
for help on using the changeset viewer.