Changeset 57 for trunk/src/user32/user32.cpp
- Timestamp:
- Jun 8, 1999, 8:59:07 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/user32.cpp
r37 r57 1 /* $Id: user32.cpp,v 1. 4 1999-06-06 12:25:49 cbratschiExp $ */1 /* $Id: user32.cpp,v 1.5 1999-06-08 18:59:07 phaller Exp $ */ 2 2 3 3 /* … … 39 39 // WIN32API ClientThreadConnect 40 40 // WIN32API DragObject 41 // WIN32API DrawCaptionTempA42 // WIN32API DrawCaptionTempW43 41 // WIN32API DrawFrame 44 42 // WIN32API EditWndProc 45 43 // WIN32API EndTask 46 44 // WIN32API GetInputDesktop 47 // WIN32API GetInternalWindowPos48 45 // WIN32API GetNextQueueWindow 49 46 // WIN32API GetShellWindow 50 47 // WIN32API InitSharedTable 51 48 // WIN32API InitTask 52 // WIN32API InternalGetWindowText53 49 // WIN32API IsHungThread 54 50 // WIN32API LockWindowStation … … 58 54 // WIN32API RegisterNetworkCapabilities 59 55 // WIN32API RegisterSystemThread 60 // WIN32API RegisterTasklist61 56 // WIN32API SetDeskWallpaper 62 57 // WIN32API SetDesktopBitmap … … 250 245 int WIN32API GetWindowTextA( HWND arg1, LPSTR arg2, int arg3) 251 246 { 252 dprintf(("USER32: GetWindowText \n"));247 dprintf(("USER32: GetWindowTextA\n")); 253 248 return O32_GetWindowText(arg1, arg2, arg3); 254 249 } 255 250 //****************************************************************************** 251 252 /******************************************************************* 253 * InternalGetWindowText (USER32.326) 254 */ 255 int WIN32API InternalGetWindowText(HWND hwnd, 256 LPWSTR lpString, 257 INT nMaxCount ) 258 { 259 dprintf(("USER32: InternalGetWindowText(%08xh,%08xh,%08xh) not properly implemented.\n", 260 hwnd, 261 lpString, 262 nMaxCount)); 263 264 return GetWindowTextW(hwnd,lpString,nMaxCount); 265 } 266 267 256 268 //****************************************************************************** 257 269 BOOL WIN32API GetWindowRect( HWND arg1, PRECT arg2) … … 2298 2310 } 2299 2311 //****************************************************************************** 2312 2313 /*********************************************************************** 2314 * GetInternalWindowPos (USER32.245) 2315 */ 2316 UINT WIN32API GetInternalWindowPos(HWND hwnd, 2317 LPRECT rectWnd, 2318 LPPOINT ptIcon ) 2319 { 2320 WINDOWPLACEMENT wndpl; 2321 2322 dprintf(("USER32: GetInternalWindowPos(%08xh,%08xh,%08xh)\n", 2323 hwnd, 2324 rectWnd, 2325 ptIcon)); 2326 2327 if (O32_GetWindowPlacement( hwnd, &wndpl )) 2328 { 2329 if (rectWnd) *rectWnd = wndpl.rcNormalPosition; 2330 if (ptIcon) *ptIcon = wndpl.ptMinPosition; 2331 return wndpl.showCmd; 2332 } 2333 return 0; 2334 } 2335 2336 2300 2337 //****************************************************************************** 2301 2338 int WIN32API GetWindowTextLengthW( HWND arg1) … … 6521 6558 return (0); /* default */ 6522 6559 } 6560 6561 6562 /*********************************************************************** 6563 * RegisterTasklist32 [USER32.436] 6564 */ 6565 DWORD WIN32API RegisterTasklist (DWORD x) 6566 { 6567 dprintf(("USER32: RegisterTasklist(%08xh) not implemented.\n", 6568 x)); 6569 6570 return TRUE; 6571 } 6572 6573 6574 /*********************************************************************** 6575 * DrawCaptionTemp32A [USER32.599] 6576 * 6577 * PARAMS 6578 * 6579 * RETURNS 6580 * Success: 6581 * Failure: 6582 */ 6583 6584 BOOL WIN32API DrawCaptionTempA(HWND hwnd, 6585 HDC hdc, 6586 const RECT *rect, 6587 HFONT hFont, 6588 HICON hIcon, 6589 LPCSTR str, 6590 UINT uFlags) 6591 { 6592 RECT rc = *rect; 6593 6594 dprintf(("USER32: DrawCaptionTempA(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n", 6595 hwnd, 6596 hdc, 6597 rect, 6598 hFont, 6599 hIcon, 6600 str, 6601 uFlags)); 6602 6603 /* drawing background */ 6604 if (uFlags & DC_INBUTTON) 6605 { 6606 O32_FillRect (hdc, 6607 &rc, 6608 GetSysColorBrush (COLOR_3DFACE)); 6609 6610 if (uFlags & DC_ACTIVE) 6611 { 6612 HBRUSH hbr = O32_SelectObject (hdc, 6613 GetSysColorBrush (COLOR_ACTIVECAPTION)); 6614 O32_PatBlt (hdc, 6615 rc.left, 6616 rc.top, 6617 rc.right - rc.left, 6618 rc.bottom - rc.top, 6619 0xFA0089); 6620 6621 O32_SelectObject (hdc, 6622 hbr); 6623 } 6624 } 6625 else 6626 { 6627 O32_FillRect (hdc, 6628 &rc, 6629 GetSysColorBrush ((uFlags & DC_ACTIVE) ? 6630 COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION)); 6631 } 6632 6633 6634 /* drawing icon */ 6635 if ((uFlags & DC_ICON) && !(uFlags & DC_SMALLCAP)) 6636 { 6637 POINT pt; 6638 6639 pt.x = rc.left + 2; 6640 pt.y = (rc.bottom + rc.top - O32_GetSystemMetrics(SM_CYSMICON)) / 2; 6641 6642 if (hIcon) 6643 { 6644 DrawIconEx (hdc, 6645 pt.x, 6646 pt.y, 6647 hIcon, 6648 O32_GetSystemMetrics(SM_CXSMICON), 6649 O32_GetSystemMetrics(SM_CYSMICON), 6650 0, 6651 0, 6652 DI_NORMAL); 6653 } 6654 else 6655 { 6656 /* @@@PH 1999/06/08 not ported yet, just don't draw any icon 6657 WND *wndPtr = WIN_FindWndPtr(hwnd); 6658 HICON hAppIcon = 0; 6659 6660 if (wndPtr->class->hIconSm) 6661 hAppIcon = wndPtr->class->hIconSm; 6662 else 6663 if (wndPtr->class->hIcon) 6664 hAppIcon = wndPtr->class->hIcon; 6665 6666 DrawIconEx (hdc, 6667 pt.x, 6668 pt.y, 6669 hAppIcon, 6670 GetSystemMetrics(SM_CXSMICON), 6671 GetSystemMetrics(SM_CYSMICON), 6672 0, 6673 0, 6674 DI_NORMAL); 6675 6676 WIN_ReleaseWndPtr(wndPtr); 6677 */ 6678 } 6679 6680 rc.left += (rc.bottom - rc.top); 6681 } 6682 6683 /* drawing text */ 6684 if (uFlags & DC_TEXT) 6685 { 6686 HFONT hOldFont; 6687 6688 if (uFlags & DC_INBUTTON) 6689 O32_SetTextColor (hdc, 6690 O32_GetSysColor (COLOR_BTNTEXT)); 6691 else 6692 if (uFlags & DC_ACTIVE) 6693 O32_SetTextColor (hdc, 6694 O32_GetSysColor (COLOR_CAPTIONTEXT)); 6695 else 6696 O32_SetTextColor (hdc, 6697 O32_GetSysColor (COLOR_INACTIVECAPTIONTEXT)); 6698 6699 O32_SetBkMode (hdc, 6700 TRANSPARENT); 6701 6702 if (hFont) 6703 hOldFont = O32_SelectObject (hdc, 6704 hFont); 6705 else 6706 { 6707 NONCLIENTMETRICSA nclm; 6708 HFONT hNewFont; 6709 6710 nclm.cbSize = sizeof(NONCLIENTMETRICSA); 6711 O32_SystemParametersInfo (SPI_GETNONCLIENTMETRICS, 6712 0, 6713 &nclm, 6714 0); 6715 hNewFont = O32_CreateFontIndirect ((uFlags & DC_SMALLCAP) ? 6716 &nclm.lfSmCaptionFont : &nclm.lfCaptionFont); 6717 hOldFont = O32_SelectObject (hdc, 6718 hNewFont); 6719 } 6720 6721 if (str) 6722 O32_DrawText (hdc, 6723 str, 6724 -1, 6725 &rc, 6726 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT); 6727 else 6728 { 6729 CHAR szText[128]; 6730 INT nLen; 6731 6732 nLen = O32_GetWindowText (hwnd, 6733 szText, 6734 128); 6735 6736 O32_DrawText (hdc, 6737 szText, 6738 nLen, 6739 &rc, 6740 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT); 6741 } 6742 6743 if (hFont) 6744 O32_SelectObject (hdc, 6745 hOldFont); 6746 else 6747 O32_DeleteObject (O32_SelectObject (hdc, 6748 hOldFont)); 6749 } 6750 6751 /* drawing focus ??? */ 6752 if (uFlags & 0x2000) 6753 { 6754 dprintf(("USER32: DrawCaptionTempA undocumented flag (0x2000)!\n")); 6755 } 6756 6757 return 0; 6758 } 6759 6760 6761 /*********************************************************************** 6762 * DrawCaptionTemp32W [USER32.602] 6763 * 6764 * PARAMS 6765 * 6766 * RETURNS 6767 * Success: 6768 * Failure: 6769 */ 6770 6771 BOOL WIN32API DrawCaptionTempW (HWND hwnd, 6772 HDC hdc, 6773 const RECT *rect, 6774 HFONT hFont, 6775 HICON hIcon, 6776 LPCWSTR str, 6777 UINT uFlags) 6778 { 6779 LPSTR strAscii = UnicodeToAsciiString((LPWSTR)str); 6780 6781 BOOL res = DrawCaptionTempA (hwnd, 6782 hdc, 6783 rect, 6784 hFont, 6785 hIcon, 6786 strAscii, 6787 uFlags); 6788 6789 FreeAsciiString(strAscii); 6790 6791 return res; 6792 }
Note:
See TracChangeset
for help on using the changeset viewer.