ReactOS  0.4.14-dev-831-gef8c9239
CTaskbarList.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: browseui
3  * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE: ITaskbarList implementation
5  * COPYRIGHT: Copyright 2018 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
10 
11 /***********************************************************************
12  * ITaskbarList2 implementation
13  */
14 
15 #define TWM_GETTASKSWITCH (WM_USER + 236)
16 
18  : m_hTaskWnd(NULL)
19 {
21 }
22 
24 {
25 }
26 
28 {
29  HWND hTrayWnd;
30  if (m_hTaskWnd && ::IsWindow(m_hTaskWnd))
31  return m_hTaskWnd;
32 
33  hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
34  if (hTrayWnd)
35  {
36  m_hTaskWnd = (HWND)SendMessageW(hTrayWnd, TWM_GETTASKSWITCH, 0L, 0L);
37  }
38  return m_hTaskWnd;
39 }
40 
42 {
43  HWND hTaskWnd = TaskWnd();
44  if (hTaskWnd && m_ShellHookMsg)
46 }
47 
48 
50 {
52  return E_NOTIMPL;
53 }
54 
55 
56 /***********************************************************************
57  * ITaskbarList implementation
58  */
59 
61 {
62  if (m_ShellHookMsg == NULL)
63  return E_OUTOFMEMORY;
64 
65  if (!TaskWnd())
66  return E_HANDLE;
67 
68  return S_OK;
69 }
70 
72 {
74  return S_OK;
75 }
76 
78 {
80  return S_OK;
81 }
82 
84 {
85  SendTaskWndShellHook(HSHELL_WINDOWACTIVATED, hwnd);
86  return S_OK;
87 }
88 
90 {
92  return E_NOTIMPL;
93 }
94 
void SendTaskWndShellHook(WPARAM wParam, HWND hWnd)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define E_HANDLE
Definition: winerror.h:2850
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
#define HSHELL_WINDOWCREATED
Definition: winuser.h:1240
HANDLE HWND
Definition: compat.h:13
virtual HRESULT STDMETHODCALLTYPE HrInit()
UINT_PTR WPARAM
Definition: windef.h:207
WPARAM wParam
Definition: combotst.c:138
#define TWM_GETTASKSWITCH
virtual HRESULT STDMETHODCALLTYPE ActivateTab(HWND hwnd)
virtual HRESULT STDMETHODCALLTYPE SetActiveAlt(HWND hwnd)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:6
UINT m_ShellHookMsg
Definition: CTaskbarList.h:17
static const WCHAR L[]
Definition: oid.c:1250
virtual HRESULT STDMETHODCALLTYPE AddTab(HWND hwnd)
#define HSHELL_WINDOWDESTROYED
Definition: winuser.h:1241
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
#define S_OK
Definition: intsafe.h:59
virtual ~CTaskbarList()
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:114
virtual HRESULT WINAPI MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen)
virtual HRESULT STDMETHODCALLTYPE DeleteTab(HWND hwnd)