ReactOS  0.4.12-dev-75-g00dd17e
BackgroundWindow Struct Reference

subclassed background window behind the visible desktop window More...

#include <desktop.h>

Inheritance diagram for BackgroundWindow:
Collaboration diagram for BackgroundWindow:

Public Types

typedef SubclassedWindow super
 
- Public Types inherited from SubclassedWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 BackgroundWindow (HWND hwnd)
 
- Public Member Functions inherited from SubclassedWindow
 SubclassedWindow (HWND)
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
void DrawDesktopBkgnd (HDC hdc)
 
- Protected Member Functions inherited from SubclassedWindow
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 

Protected Attributes

int _display_version
 
- Protected Attributes inherited from SubclassedWindow
WNDPROC _orgWndProc
 

Additional Inherited Members

- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Protected Member Functions inherited from SubclassedWindow
static LRESULT CALLBACK SubclassedWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

subclassed background window behind the visible desktop window

Definition at line 35 of file desktop.h.

Member Typedef Documentation

◆ super

Definition at line 37 of file desktop.h.

Constructor & Destructor Documentation

◆ BackgroundWindow()

BackgroundWindow::BackgroundWindow ( HWND  hwnd)

Definition at line 259 of file desktop.cpp.

260  : super(hwnd)
261 {
262  // set background brush for the short moment of displaying the
263  // background color while moving foreground windows
265 
266  _display_version = RegGetDWORDValue(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), TEXT("PaintDesktopVersion"), 1);
267 }
int _display_version
Definition: desktop.h:46
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define SetClassLongPtr
Definition: winuser.h:5714
LONG RegGetDWORDValue(IN HKEY hKey, IN LPCWSTR lpSubKey OPTIONAL, IN LPCWSTR lpValue OPTIONAL, OUT LPDWORD lpData OPTIONAL)
Definition: regutils.c:95
SubclassedWindow super
Definition: desktop.h:37
#define TEXT(s)
Definition: k32.h:26
#define GCL_HBRBACKGROUND
Definition: winuser.h:659
#define COLOR_BACKGROUND
Definition: hardware.h:164

Member Function Documentation

◆ DrawDesktopBkgnd()

void BackgroundWindow::DrawDesktopBkgnd ( HDC  hdc)
protected

Definition at line 301 of file desktop.cpp.

Referenced by WndProc().

302 {
303  PaintDesktop(hdc);
304 
305 /* special solid background
306  HBRUSH bkgndBrush = CreateSolidBrush(RGB(0,32,160)); // dark blue
307  FillRect(hdc, &rect, bkgndBrush);
308  DeleteBrush(bkgndBrush);
309 */
310 }
HDC hdc
Definition: msvc.h:53
BOOL WINAPI PaintDesktop(_In_ HDC)

◆ WndProc()

LRESULT BackgroundWindow::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual
Todo:
Changing the PaintDesktopVersion-Flag needs a restart of the shell -> display a message box

Reimplemented from SubclassedWindow.

Definition at line 269 of file desktop.cpp.

Referenced by DesktopWindow::SendControlMsg().

270 {
271  switch(nmsg) {
272  case WM_ERASEBKGND:
274  return TRUE;
275 
276  case WM_MBUTTONDBLCLK:
277  /* Imagelist icons are missing if MainFrame::Create() is called directly from here!
278  explorer_show_frame(SW_SHOWNORMAL); */
280  break;
281 
282  case PM_DISPLAY_VERSION:
283  if (lparam || wparam) {
284  DWORD or_mask = wparam;
285  DWORD reset_mask = LOWORD(lparam);
286  DWORD xor_mask = HIWORD(lparam);
287  _display_version = ((_display_version&~reset_mask) | or_mask) ^ xor_mask;
288  RegSetDWORDValue(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), TEXT("PaintDesktopVersion"), _display_version);
290  InvalidateRect(_hwnd, NULL, TRUE);
291  }
292  return _display_version;
293 
294  default:
295  return super::WndProc(nmsg, wparam, lparam);
296  }
297 
298  return 0;
299 }
void DrawDesktopBkgnd(HDC hdc)
Definition: desktop.cpp:301
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
LONG RegSetDWORDValue(IN HKEY hKey, IN LPCWSTR lpSubKey OPTIONAL, IN LPCWSTR lpValue OPTIONAL, IN BOOL bCreateKeyIfDoesntExist, IN DWORD dwData)
Definition: regutils.c:162
int _display_version
Definition: desktop.h:46
#define PM_DISPLAY_VERSION
Definition: desktop.h:31
#define HKEY_CURRENT_USER
Definition: winreg.h:11
smooth NULL
Definition: ftsmooth.c:416
#define PostMessage
Definition: winuser.h:5698
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned long DWORD
Definition: ntddk_ex.h:95
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define WM_MBUTTONDBLCLK
Definition: winuser.h:1760
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
#define TEXT(s)
Definition: k32.h:26
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:343
#define HIWORD(l)
Definition: typedefs.h:246
#define WM_ERASEBKGND
Definition: winuser.h:1607
HWND _hwndDesktop
Definition: globals.h:289
#define LOWORD(l)
Definition: pedump.c:82
UINT WPARAM wparam
Definition: msvc.h:92

Member Data Documentation

◆ _display_version

int BackgroundWindow::_display_version
protected

Definition at line 46 of file desktop.h.

Referenced by BackgroundWindow(), and WndProc().


The documentation for this struct was generated from the following files: