ReactOS  0.4.13-dev-66-gc714b7f
trayprop.cpp File Reference
#include "precomp.h"
Include dependency graph for trayprop.cpp:

Go to the source code of this file.

Classes

class  CTaskBarSettingsPage
 
class  CStartMenuSettingsPage
 

Functions

static void SetBitmap (HWND hwnd, HBITMAP *hbmp, UINT uImageId)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
VOID DisplayTrayProperties (IN HWND hwndOwner, IN HWND hwndTaskbar)
 

Function Documentation

◆ DisplayTrayProperties()

VOID DisplayTrayProperties ( IN HWND  hwndOwner,
IN HWND  hwndTaskbar 
)

Definition at line 291 of file trayprop.cpp.

292 {
293  PROPSHEETHEADER psh;
294  HPROPSHEETPAGE hpsp[2];
295  CTaskBarSettingsPage tbSettingsPage(hwndTaskbar);
296  CStartMenuSettingsPage smSettingsPage;
297  CStringW caption;
298 
299  caption.LoadStringW(IDS_TASKBAR_STARTMENU_PROP_CAPTION);
300 
301  hpsp[0] = tbSettingsPage.Create();
302  hpsp[1] = smSettingsPage.Create();
303 
304  ZeroMemory(&psh, sizeof(psh));
305  psh.dwSize = sizeof(psh);
306  psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
307  psh.hwndParent = hwndOwner;
308  psh.hInstance = hExplorerInstance;
309  psh.pszIcon = MAKEINTRESOURCEW(IDI_STARTMENU);
310  psh.pszCaption = caption.GetString();
311  psh.nPages = _countof(hpsp);
312  psh.nStartPage = 0;
313  psh.phpage = hpsp;
314  psh.pfnCallback = PropSheetProc;
315 
316  PropertySheet(&psh);
317 }
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
#define _countof(array)
Definition: fontsub.cpp:30
#define IDI_STARTMENU
Definition: resource.h:14
#define ZeroMemory
Definition: winbase.h:1635
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_USEICONID
Definition: prsht.h:42
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PROPSHEETHEADER
Definition: prsht.h:374
#define PSH_PROPTITLE
Definition: prsht.h:40
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
PCXSTR GetString() const
Definition: atlsimpstr.h:361
#define PropertySheet
Definition: prsht.h:382
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: trayprop.cpp:274
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_TASKBAR_STARTMENU_PROP_CAPTION
Definition: resource.h:103

Referenced by CTrayWindow::TrayPropertiesThread().

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 274 of file trayprop.cpp.

275 {
276  // NOTE: This callback is needed to set large icon correctly.
277  HICON hIcon;
278  switch (uMsg)
279  {
280  case PSCB_INITIALIZED:
281  {
283  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
284  break;
285  }
286  }
287  return 0;
288 }
static HICON
Definition: imagelist.c:84
#define IDI_STARTMENU
Definition: resource.h:14
LONG_PTR LPARAM
Definition: windef.h:208
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by DisplayTrayProperties().

◆ SetBitmap()

static void SetBitmap ( HWND  hwnd,
HBITMAP hbmp,
UINT  uImageId 
)
static

Definition at line 24 of file trayprop.cpp.

25 {
26  if (*hbmp)
28 
30  MAKEINTRESOURCEW(uImageId),
32  0,
33  0,
35 
36  if (*hbmp && hwnd)
37  {
38  BITMAP bm;
39  GetObject(*hbmp, sizeof(bm), &bm);
40  ::SetWindowPos(hwnd, NULL, 0, 0, bm.bmWidth + 2, bm.bmHeight + 2,
43  }
44 
45 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define SWP_NOZORDER
Definition: winuser.h:1232
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
HBITMAP hbmp
#define SWP_NOACTIVATE
Definition: winuser.h:1227
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define GetObject
Definition: wingdi.h:4446
Definition: bl.h:1331
#define IMAGE_BITMAP
Definition: winuser.h:211
#define STM_SETIMAGE
Definition: winuser.h:2054
#define SendMessage
Definition: winuser.h:5709
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077

Referenced by DECLARE_INTERFACE_(), CTaskBarSettingsPage::UpdateDialog(), and CStartMenuSettingsPage::UpdateDialog().