Implemented the PSH_USEICONID/PSH_USEHICON and the PSP_USETITLE

flags.
This commit is contained in:
Thuy Nguyen 1999-08-18 18:25:46 +00:00 committed by Alexandre Julliard
parent 0007842ed8
commit 43faed996a
1 changed files with 33 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include "winnls.h"
#include "comctl32.h"
#include "debugtools.h"
#include "heap.h"
/******************************************************************************
@ -273,6 +274,13 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEA lppsp,
TRACE("Tab %d %s\n",index,debugstr_w((LPCWSTR)p));
p += lstrlenW((LPCWSTR)p) + 1;
if (dwFlags & PSP_USETITLE)
{
psInfo->proppage[index].pszText = HEAP_strdupAtoW(GetProcessHeap(),
0,
lppsp->pszTitle);
}
/*
* Build the image list for icons
*/
@ -1290,6 +1298,31 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
LPCPROPSHEETPAGEA ppshpage;
/*
* Small icon in the title bar.
*/
if ((psInfo->ppshheader->dwFlags & PSH_USEICONID) ||
(psInfo->ppshheader->dwFlags & PSH_USEHICON))
{
HICON hIcon;
int icon_cx = GetSystemMetrics(SM_CXSMICON);
int icon_cy = GetSystemMetrics(SM_CYSMICON);
if (psInfo->ppshheader->dwFlags & PSH_USEICONID)
hIcon = LoadImageA(psInfo->ppshheader->hInstance,
psInfo->ppshheader->u1.pszIcon,
IMAGE_ICON,
icon_cx, icon_cy,
LR_DEFAULTCOLOR);
else
hIcon = psInfo->ppshheader->u1.hIcon;
SendMessageA(hwnd, WM_SETICON, 0, hIcon);
}
if (psInfo->ppshheader->dwFlags & PSH_USEHICON)
SendMessageA(hwnd, WM_SETICON, 0, psInfo->ppshheader->u1.hIcon);
psInfo->strPropertiesFor = strCaption;
GetWindowTextA(hwnd, psInfo->strPropertiesFor, MAX_CAPTION_LENGTH);