Sat Jul 25 19:45:45 1998 Juergen Schmied <juergen.schmied@metronet.de> * [include/shlobj.h][misc/shell.c][misc/shellord.c][ole/folders.c] [shell32.spec] Added SHFILEOPSTRUCT32[A|W] and constants, prototypes. Implemented SHGetSpecialFolderLocation, SHGetPathFromIDList32[A]. Many IShellFolder, pidl, shell -related changes. SHChangeNotifyRegister, SHChangeNotifyDeregister, SHShellFolderView_Message, SHMapPIDLToSystemImageListIndex, SHAddToRecentDocs32, SHFileOperation, SHChangeNotify, SHCreateShellFolderViewEx stubs. Sat Jul 25 17:16:25 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [files/profile.c] Fix return value of PROFILE_GetSection(). Fri Jul 24 22:45:19 1998 Ove Kaaven <ovek@isflak.arcticnet.no> * [controls/edit.c] Killed the modified flag on WM_SETTEXT. Eudora should no longer bother asking whether you want to save an unchanged message. Fri Jul 24 21:21:35 1998 Andreas Mohr <100.30936@germany.net> * [controls/menu.c] Fixed bug in GetMenuState32. Doesn't fix Free Agent 32 :(( * [documentation/debugging] Hints added. * [files/dos_fs.c] [include/msdos.h] [msdos/int21.c] Enhanced DOS device support. * [if1632/Makefile.in] [if1632/builtin.c] [if1632/rasapi16.spec] [relay32/Makefile.in] [relay32/builtin32.c] [relay32/rasapi32.spec] Added RASAPI16/32.DLL. * [misc/aspi.c] [relay32/wnaspi32.spec] Implemented GetASPI32SupportInfo. * [multimedia/mmsystem.c] Implemented mmTaskCreate. Fri Jul 24 20:55:31 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [controls/toolbar.c] Fixed some bugs and added new features. * [controls/tooltips.c][include/tooltips.h] Added more messages and started display code. * [misc/shell.c][misc/shellord.c][relay32/shell.spec] Fixed StrToOleStrN (SHELL32_79) and added OleStrToStrN (SHELL32_78). Added some new stubs. * [objects/cursoricon.c][misc/imagelist.c][include/windows.h] Fixed GetIconInfo and removed the GetIconInfo hack from the image list code. * [controls/pager.c][include/pager.h][controls/treeview.c] [include/treeview.h] Added some messages. * [misc/tweak.c][winows/nonclient.c][documentation/win95look] Removed unused tweak variables. * [documentation/common_controls] Updated. Fri Jul 24 18:36:32 1998 James Moody <013263m@dragon.acadiau.ca> * [objects/font.c] Fixed a bug in GetTextFace. Fri Jul 24 17:09:33 1998 Marcus Meissner <marcus@jet.franken.de> * [misc/commdlg.c] Fixed stacksmashing bug due to invalid specified function pointers. * [files/dos_fs.c] Small change in case handling... be able to create files with uppercase in them (like Program Files/). * [graphics/ddraw.c] XF86DGA support made threadsafe, added more Xlib dependent stuff (create Window using CreateWindow(), draw into it). xlib support is not satisfying. * [scheduler/critsection.c] Don't recurse on HeapLock with semaphore id 0. * [win32/user32.c][windows/message.c][windows/event.c] Moved win32 *Message functions where they belong. Removed some potential races between XPending and XNextEvent by a bit more locking. Fri Jul 24 13:58:19 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [loader/pe_image.c] [loader/ne/segment.c] Use bogus pointer value instead of NULL for unresolved externals. * [memory/selector.c] Clear saved_fs on selector free. * [msdos/cdrom.c] [configure.in] Added check for linux/ucdrom.h. * [scheduler/client.c] [server/socket.c] Fix for missing struct cmsghdr. Attempt to support msg_accrights fd passing (completely untested). * [windows/event.c] Do not grab the pointer in SetCapture (Win32 behavior). Tue Jul 21 22:28:13 1998 James Juran <jrj120@psu.edu> * [Make.rules.in] Changed $(MKDIR) macro to use -p option (make parent directories if they don't already exist. This fixes an error in 'make install' if /usr/local/include doesn't already exist. Tue Jul 21 13:37:04 Rein Klazes <rklazes@casema.net> * [include/heap.h] Replaced macro SEGPTR_GET by inline function to avoid *lots* of wrong use of this macro. * [relay32/comdlg32.spec] Corrected GetSaveFileNameW entry. * [relay32/advapi32.spec] [win32/advapi.c] [relay32/ole32.spec] [ ole/moniker.c] Added stubs for SetFileSecurity[AW] and CreateFileMoniker32 * [graphics/x11drv/graphics.c] Finished implementation of bezier drawing code. Tue Jul 21 11:00:51 1998 Claus Fischer <cfischer@td2cad.intel.com> * [files/drive.c] Remove label trailing blanks in GetVolumeInformation32A. * [documentation/cdrom-labels] Added documentation on how to find out a CD-ROM label. Sun Jul 19 23:16:41 1998 Pascal Cuoq <pcuoq@ens-lyon.fr> * [include/windows.h] Added some DM_* and DISP_CHANGE_* flags. * [relay32/user32.spec] [windows/user.c] Added stub for ChangeDisplaySettingA. * [ole/ole2nls.c] is_punctuation: reuse information from another table. Sun Jul 19 22:04:46 1998 Douglas Ridgway <ridgway@winehq.com> * [Make.rules.in] Updated automatic documentation rules. * [graphics/path.c] [misc/aspi.c] [misc/ntdll.c] [misc/winsock_dns.c] [ole/ole2dsp.c] [relay32/user32.spec] Comment format futzing to keep c2man happy. * [documentation/README.documentation] Updated description of automatic documentation. Wed Jul 15 19:10:09 1998 Andrew M. Bishop <amb@gedanken.demon.co.uk> * [files/profile.c] Cache the 10 most recently used .ini files. Tue May 20 19:20:23 1997 Pablo Saratxaga <srtxg@chanae.alphanet.ch> * [misc/commdlg.c] Makes PrintDlg32A() return TRUE even if it is an empty stub, so most programs are happy and run anyway instead of aborting at startup. * [graphics/x11drv/xfont.c] Increased the maximum font families as (X11) font aliases eated up a lot of families causing wine to stop reading fonts.
547 lines
14 KiB
C
547 lines
14 KiB
C
/*
|
|
* Common controls functions
|
|
*
|
|
* Copyright 1997 Dimitrie O. Paun
|
|
* Copyright 1998 Eric Kohl
|
|
*
|
|
*/
|
|
|
|
#include "win.h"
|
|
#include "heap.h"
|
|
#include "commctrl.h"
|
|
#include "header.h"
|
|
#include "listview.h"
|
|
#include "pager.h"
|
|
#include "progress.h"
|
|
#include "rebar.h"
|
|
#include "status.h"
|
|
#include "toolbar.h"
|
|
#include "tooltips.h"
|
|
#include "trackbar.h"
|
|
#include "treeview.h"
|
|
#include "updown.h"
|
|
#include "debug.h"
|
|
|
|
|
|
/***********************************************************************
|
|
* DrawStatusText32A [COMCTL32.5][COMCTL32.27]
|
|
*
|
|
* Draws text with borders, like in a status bar.
|
|
*
|
|
* PARAMS
|
|
* hdc [I] handle to the window's display context
|
|
* lprc [I] pointer to a rectangle
|
|
* text [I] pointer to the text
|
|
* style [I]
|
|
*/
|
|
|
|
VOID WINAPI
|
|
DrawStatusText32A (HDC32 hdc, LPRECT32 lprc, LPCSTR text, UINT32 style)
|
|
{
|
|
RECT32 r = *lprc;
|
|
UINT32 border = BDR_SUNKENOUTER;
|
|
|
|
if (style == SBT_POPOUT)
|
|
border = BDR_RAISEDOUTER;
|
|
else if (style == SBT_NOBORDERS)
|
|
border = 0;
|
|
|
|
DrawEdge32 (hdc, &r, border, BF_RECT|BF_ADJUST|BF_MIDDLE);
|
|
|
|
/* now draw text */
|
|
if (text) {
|
|
int oldbkmode = SetBkMode32 (hdc, TRANSPARENT);
|
|
r.left += 3;
|
|
DrawText32A (hdc, text, lstrlen32A(text),
|
|
&r, DT_LEFT|DT_VCENTER|DT_SINGLELINE);
|
|
if (oldbkmode != TRANSPARENT)
|
|
SetBkMode32(hdc, oldbkmode);
|
|
}
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* DrawStatusText32W [COMCTL32.28]
|
|
*/
|
|
void WINAPI DrawStatusText32W( HDC32 hdc, LPRECT32 lprc, LPCWSTR text,
|
|
UINT32 style )
|
|
{
|
|
LPSTR p = HEAP_strdupWtoA( GetProcessHeap(), 0, text );
|
|
DrawStatusText32A(hdc, lprc, p, style);
|
|
HeapFree( GetProcessHeap(), 0, p );
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* CreateStatusWindow32A [COMCTL32.6][COMCTL32.21]
|
|
*/
|
|
HWND32 WINAPI CreateStatusWindow32A( INT32 style, LPCSTR text, HWND32 parent,
|
|
UINT32 wid )
|
|
{
|
|
return CreateWindow32A(STATUSCLASSNAME32A, text, style,
|
|
CW_USEDEFAULT32, CW_USEDEFAULT32,
|
|
CW_USEDEFAULT32, CW_USEDEFAULT32,
|
|
parent, wid, 0, 0);
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* CreateStatusWindow32W (COMCTL32.22)
|
|
*/
|
|
HWND32 WINAPI CreateStatusWindow32W( INT32 style, LPCWSTR text, HWND32 parent,
|
|
UINT32 wid )
|
|
{
|
|
return CreateWindow32W((LPCWSTR)STATUSCLASSNAME32W, text, style,
|
|
CW_USEDEFAULT32, CW_USEDEFAULT32,
|
|
CW_USEDEFAULT32, CW_USEDEFAULT32,
|
|
parent, wid, 0, 0);
|
|
}
|
|
|
|
/***********************************************************************
|
|
* CreateUpDownControl (COMCTL32.16)
|
|
*/
|
|
HWND32 WINAPI CreateUpDownControl( DWORD style, INT32 x, INT32 y,
|
|
INT32 cx, INT32 cy, HWND32 parent,
|
|
INT32 id, HINSTANCE32 inst, HWND32 buddy,
|
|
INT32 maxVal, INT32 minVal, INT32 curVal )
|
|
{
|
|
HWND32 hUD = CreateWindow32A(UPDOWN_CLASS32A, 0, style, x, y, cx, cy,
|
|
parent, id, inst, 0);
|
|
if(hUD){
|
|
SendMessage32A(hUD, UDM_SETBUDDY, buddy, 0);
|
|
SendMessage32A(hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal));
|
|
SendMessage32A(hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0));
|
|
}
|
|
|
|
return hUD;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* InitCommonControls [COMCTL32.17]
|
|
*
|
|
* Registers the common controls.
|
|
*
|
|
* PARAMS
|
|
* None.
|
|
*
|
|
* NOTES
|
|
* Calls InitCommonControlsEx.
|
|
* InitCommonControlsEx should be used instead.
|
|
*/
|
|
|
|
VOID WINAPI
|
|
InitCommonControls (VOID)
|
|
{
|
|
INITCOMMONCONTROLSEX icc;
|
|
|
|
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
|
icc.dwICC = ICC_WIN95_CLASSES;
|
|
|
|
InitCommonControlsEx (&icc);
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* InitCommonControlsEx [COMCTL32.81]
|
|
*
|
|
* Registers the common controls.
|
|
*
|
|
* PARAMS
|
|
* lpInitCtrls [I] pointer to a INITCOMMONCONTROLS structure.
|
|
*/
|
|
|
|
BOOL32 WINAPI
|
|
InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
|
|
{
|
|
INT32 cCount;
|
|
DWORD dwMask;
|
|
|
|
if (lpInitCtrls == NULL) return FALSE;
|
|
if (lpInitCtrls->dwSize < sizeof(INITCOMMONCONTROLSEX)) return FALSE;
|
|
|
|
for (cCount = 0; cCount <= 31; cCount++) {
|
|
dwMask = 1 << cCount;
|
|
if (!(lpInitCtrls->dwICC & dwMask))
|
|
continue;
|
|
|
|
switch (lpInitCtrls->dwICC & dwMask) {
|
|
case ICC_LISTVIEW_CLASSES:
|
|
LISTVIEW_Register ();
|
|
HEADER_Register ();
|
|
break;
|
|
|
|
case ICC_TREEVIEW_CLASSES:
|
|
TREEVIEW_Register ();
|
|
TOOLTIPS_Register ();
|
|
break;
|
|
|
|
case ICC_BAR_CLASSES:
|
|
TOOLBAR_Register ();
|
|
STATUS_Register ();
|
|
TRACKBAR_Register ();
|
|
TOOLTIPS_Register ();
|
|
break;
|
|
|
|
case ICC_TAB_CLASSES:
|
|
TRACE (commctrl, "No tab class implemented!\n");
|
|
TOOLTIPS_Register ();
|
|
UPDOWN_Register ();
|
|
break;
|
|
|
|
case ICC_UPDOWN_CLASS:
|
|
UPDOWN_Register ();
|
|
break;
|
|
|
|
case ICC_PROGRESS_CLASS:
|
|
PROGRESS_Register ();
|
|
break;
|
|
|
|
case ICC_HOTKEY_CLASS:
|
|
TRACE (commctrl, "No hotkey class implemented!\n");
|
|
break;
|
|
|
|
case ICC_ANIMATE_CLASS:
|
|
TRACE (commctrl, "No animation class implemented!\n");
|
|
break;
|
|
|
|
/* advanced classes - not included in Win95 */
|
|
case ICC_DATE_CLASSES:
|
|
TRACE (commctrl, "No month calendar class implemented!\n");
|
|
TRACE (commctrl, "No date picker class implemented!\n");
|
|
TRACE (commctrl, "No time picker class implemented!\n");
|
|
UPDOWN_Register ();
|
|
break;
|
|
|
|
case ICC_USEREX_CLASSES:
|
|
TRACE (commctrl, "No comboex class implemented!\n");
|
|
break;
|
|
|
|
case ICC_COOL_CLASSES:
|
|
REBAR_Register ();
|
|
break;
|
|
|
|
case ICC_INTERNET_CLASSES:
|
|
TRACE (commctrl, "No IPAddress class implemented!\n");
|
|
break;
|
|
|
|
case ICC_PAGESCROLLER_CLASS:
|
|
PAGER_Register ();
|
|
break;
|
|
|
|
case ICC_NATIVEFNTCTL_CLASS:
|
|
TRACE (commctrl, "No native font class implemented!\n");
|
|
break;
|
|
|
|
default:
|
|
WARN (commctrl, "Unknown class! dwICC=0x%lX\n", dwMask);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* MenuHelp [COMCTL32.2]
|
|
*
|
|
* PARAMS
|
|
* uMsg
|
|
* wParam
|
|
* lParam
|
|
* hMainMenu
|
|
* hInst
|
|
* hwndStatus
|
|
* lpwIDs
|
|
*/
|
|
|
|
VOID WINAPI
|
|
MenuHelp (UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, HMENU32 hMainMenu,
|
|
HINSTANCE32 hInst, HWND32 hwndStatus, LPUINT32 lpwIDs)
|
|
{
|
|
char szStatusText[128];
|
|
|
|
if (!IsWindow32 (hwndStatus)) return;
|
|
|
|
switch (uMsg) {
|
|
case WM_MENUSELECT:
|
|
TRACE (commctrl, "WM_MENUSELECT wParam=0x%X lParam=0x%lX\n",
|
|
wParam, lParam);
|
|
|
|
if ((HIWORD(wParam) == 0xFFFF) && (lParam == 0)) {
|
|
/* menu was closed */
|
|
SendMessage32A (hwndStatus, SB_SIMPLE, FALSE, 0);
|
|
}
|
|
else {
|
|
if (HIWORD(wParam) & MF_POPUP) {
|
|
FIXME (commctrl, "popup 0x%08x 0x%08lx\n", wParam, lParam);
|
|
|
|
szStatusText[0] = 0;
|
|
}
|
|
else {
|
|
TRACE (commctrl, "menu item selected!\n");
|
|
if (!LoadString32A (hInst, LOWORD(wParam), szStatusText, 128))
|
|
szStatusText[0] = 0;
|
|
}
|
|
SendMessage32A (hwndStatus, SB_SETTEXT32A, 255 | SBT_NOBORDERS,
|
|
(LPARAM)szStatusText);
|
|
SendMessage32A (hwndStatus, SB_SIMPLE, TRUE, 0);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
WARN (commctrl, "Invalid Message!\n");
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* CreateToolbarEx [COMCTL32.32]
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
|
|
HWND32 WINAPI
|
|
CreateToolbarEx (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
|
|
HINSTANCE32 hBMInst, UINT32 wBMID, LPCTBBUTTON lpButtons,
|
|
INT32 iNumButtons, INT32 dxButton, INT32 dyButton,
|
|
INT32 dxBitmap, INT32 dyBitmap, UINT32 uStructSize)
|
|
{
|
|
HWND32 hwndTB =
|
|
CreateWindowEx32A (0, TOOLBARCLASSNAME32A, "", style, 0, 0, 0, 0,
|
|
hwnd, (HMENU32)wID, 0, NULL);
|
|
if(hwndTB) {
|
|
TBADDBITMAP tbab;
|
|
|
|
SendMessage32A (hwndTB, TB_BUTTONSTRUCTSIZE,
|
|
(WPARAM32)uStructSize, 0);
|
|
|
|
/* set bitmap and button size */
|
|
if (hBMInst == HINST_COMMCTRL) {
|
|
if (wBMID & 1) {
|
|
SendMessage32A (hwndTB, TB_SETBITMAPSIZE, 0,
|
|
MAKELPARAM(26, 25));
|
|
SendMessage32A (hwndTB, TB_SETBUTTONSIZE, 0,
|
|
MAKELPARAM(33, 32));
|
|
}
|
|
else {
|
|
SendMessage32A (hwndTB, TB_SETBITMAPSIZE, 0,
|
|
MAKELPARAM(16, 15));
|
|
SendMessage32A (hwndTB, TB_SETBUTTONSIZE, 0,
|
|
MAKELPARAM(23, 22));
|
|
}
|
|
}
|
|
else {
|
|
SendMessage32A (hwndTB, TB_SETBITMAPSIZE, 0,
|
|
MAKELPARAM((WORD)dyBitmap, (WORD)dxBitmap));
|
|
SendMessage32A (hwndTB, TB_SETBUTTONSIZE, 0,
|
|
MAKELPARAM((WORD)dyButton, (WORD)dxButton));
|
|
}
|
|
|
|
/* add bitmaps */
|
|
tbab.hInst = hBMInst;
|
|
tbab.nID = wBMID;
|
|
SendMessage32A (hwndTB, TB_ADDBITMAP,
|
|
(WPARAM32)nBitmaps, (LPARAM)&tbab);
|
|
|
|
/* add buttons */
|
|
SendMessage32A (hwndTB, TB_ADDBUTTONS32A,
|
|
(WPARAM32)iNumButtons, (LPARAM)lpButtons);
|
|
}
|
|
|
|
return hwndTB;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* CreateMappedBitmap [COMCTL32.8]
|
|
*
|
|
* PARAMS
|
|
* hInstance
|
|
* idBitmap
|
|
* wFlags
|
|
* lpColorMap
|
|
* iNumMaps
|
|
*/
|
|
|
|
HBITMAP32 WINAPI
|
|
CreateMappedBitmap (HINSTANCE32 hInstance, INT32 idBitmap, UINT32 wFlags,
|
|
LPCOLORMAP lpColorMap, INT32 iNumMaps)
|
|
{
|
|
HGLOBAL32 hglb;
|
|
HRSRC32 hRsrc;
|
|
LPBITMAPINFOHEADER lpBitmap, lpBitmapInfo;
|
|
UINT32 nSize, nColorTableSize;
|
|
DWORD *pColorTable;
|
|
INT32 iColor, i, iMaps, nWidth, nHeight;
|
|
HDC32 hdcScreen;
|
|
HBITMAP32 hbm;
|
|
LPCOLORMAP sysColorMap;
|
|
COLORMAP internalColorMap[4] =
|
|
{{0x000000, 0}, {0x808080, 0}, {0xC0C0C0, 0}, {0xFFFFFF, 0}};
|
|
|
|
/* initialize pointer to colortable and default color table */
|
|
if (lpColorMap) {
|
|
iMaps = iNumMaps;
|
|
sysColorMap = lpColorMap;
|
|
}
|
|
else {
|
|
internalColorMap[0].to = GetSysColor32 (COLOR_BTNTEXT);
|
|
internalColorMap[1].to = GetSysColor32 (COLOR_BTNSHADOW);
|
|
internalColorMap[2].to = GetSysColor32 (COLOR_BTNFACE);
|
|
internalColorMap[3].to = GetSysColor32 (COLOR_BTNHIGHLIGHT);
|
|
iMaps = 4;
|
|
sysColorMap = (LPCOLORMAP)internalColorMap;
|
|
}
|
|
|
|
hRsrc = FindResource32A (hInstance, (LPSTR)idBitmap, RT_BITMAP32A);
|
|
if (hRsrc == 0)
|
|
return 0;
|
|
hglb = LoadResource32 (hInstance, hRsrc);
|
|
if (hglb == 0)
|
|
return 0;
|
|
lpBitmap = (LPBITMAPINFOHEADER)LockResource32 (hglb);
|
|
if (lpBitmap == NULL)
|
|
return 0;
|
|
|
|
nColorTableSize = (1 << lpBitmap->biBitCount);
|
|
nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD);
|
|
lpBitmapInfo = (LPBITMAPINFOHEADER)GlobalAlloc32 (GMEM_FIXED, nSize);
|
|
if (lpBitmapInfo == NULL)
|
|
return 0;
|
|
RtlMoveMemory (lpBitmapInfo, lpBitmap, nSize);
|
|
|
|
pColorTable = (DWORD*)(((LPBYTE)lpBitmapInfo)+(UINT32)lpBitmapInfo->biSize);
|
|
|
|
for (iColor = 0; iColor < nColorTableSize; iColor++) {
|
|
for (i = 0; i < iMaps; i++) {
|
|
if (pColorTable[iColor] == sysColorMap[i].from) {
|
|
#if 0
|
|
if (wFlags & CBS_MASKED) {
|
|
if (sysColorMap[i].to != COLOR_BTNTEXT)
|
|
pColorTable[iColor] = RGB(255, 255, 255);
|
|
}
|
|
else
|
|
#endif
|
|
pColorTable[iColor] = sysColorMap[i].to;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
nWidth = (INT32)lpBitmapInfo->biWidth;
|
|
nHeight = (INT32)lpBitmapInfo->biHeight;
|
|
hdcScreen = GetDC32 ((HWND32)0);
|
|
hbm = CreateCompatibleBitmap32 (hdcScreen, nWidth, nHeight);
|
|
if (hbm) {
|
|
HDC32 hdcDst = CreateCompatibleDC32 (hdcScreen);
|
|
HBITMAP32 hbmOld = SelectObject32 (hdcDst, hbm);
|
|
LPBYTE lpBits = (LPBYTE)(lpBitmap + 1);
|
|
lpBits += (1 << (lpBitmapInfo->biBitCount)) * sizeof(RGBQUAD);
|
|
StretchDIBits32 (hdcDst, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
|
|
lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS,
|
|
SRCCOPY);
|
|
SelectObject32 (hdcDst, hbmOld);
|
|
DeleteDC32 (hdcDst);
|
|
}
|
|
ReleaseDC32 ((HWND32)0, hdcScreen);
|
|
GlobalFree32 ((HGLOBAL32)lpBitmapInfo);
|
|
FreeResource32 (hglb);
|
|
|
|
return hbm;
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* CreateToolbar [COMCTL32.7]
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
|
|
HWND32 WINAPI
|
|
CreateToolbar (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
|
|
HINSTANCE32 hBMInst, UINT32 wBMID,
|
|
LPCOLDTBBUTTON lpButtons,INT32 iNumButtons)
|
|
{
|
|
return CreateToolbarEx (hwnd, style | CCS_NODIVIDER, wID, nBitmaps,
|
|
hBMInst, wBMID, (LPCTBBUTTON)lpButtons,
|
|
iNumButtons, 0, 0, 0, 0, sizeof (OLDTBBUTTON));
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* GetEffectiveClientRect [COMCTL32.4]
|
|
*
|
|
* PARAMS
|
|
* hwnd [I] handle to the client window.
|
|
* lpRect [O] pointer to the rectangle of the client window
|
|
* lpInfo [I] pointer to an array of integers
|
|
*
|
|
* NOTES
|
|
*/
|
|
|
|
VOID WINAPI
|
|
GetEffectiveClientRect (HWND32 hwnd, LPRECT32 lpRect, LPINT32 lpInfo)
|
|
{
|
|
RECT32 rcCtrl;
|
|
INT32 *lpRun;
|
|
HWND32 hwndCtrl;
|
|
|
|
TRACE (commctrl, "(0x%08lx 0x%08lx 0x%08lx)\n",
|
|
(DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo);
|
|
|
|
GetClientRect32 (hwnd, lpRect);
|
|
lpRun = lpInfo;
|
|
|
|
do {
|
|
lpRun += 2;
|
|
if (*lpRun == 0)
|
|
return;
|
|
lpRun++;
|
|
hwndCtrl = GetDlgItem32 (hwnd, *lpRun);
|
|
if (GetWindowLong32A (hwndCtrl, GWL_STYLE) & WS_VISIBLE) {
|
|
TRACE (commctrl, "control id 0x%x\n", *lpRun);
|
|
GetWindowRect32 (hwndCtrl, &rcCtrl);
|
|
MapWindowPoints32 ((HWND32)0, hwnd, (LPPOINT32)&rcCtrl, 2);
|
|
SubtractRect32 (lpRect, lpRect, &rcCtrl);
|
|
}
|
|
lpRun++;
|
|
} while (*lpRun);
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* ShowHideMenuCtl [COMCTL32.3]
|
|
*
|
|
* PARAMS
|
|
* hwnd [I] handle to the client window.
|
|
* uFlags [I] menu command id
|
|
* lpInfo [I] pointer to an array of integers
|
|
*
|
|
* NOTES
|
|
*/
|
|
|
|
BOOL32 WINAPI
|
|
ShowHideMenuCtl (HWND32 hwnd, UINT32 uFlags, LPINT32 lpInfo)
|
|
{
|
|
FIXME (commctrl, "(0x%08x 0x%08x %p): empty stub!\n",
|
|
hwnd, uFlags, lpInfo);
|
|
#if 0
|
|
if (GetMenuState (lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) {
|
|
/* checked -> hide control */
|
|
|
|
}
|
|
else {
|
|
/* not checked -> show control */
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return FALSE;
|
|
}
|
|
|