summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/clnplus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_nicer/src/clnplus.cpp')
-rw-r--r--plugins/Clist_nicer/src/clnplus.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/plugins/Clist_nicer/src/clnplus.cpp b/plugins/Clist_nicer/src/clnplus.cpp
index 158f9cac3e..eed275b1e3 100644
--- a/plugins/Clist_nicer/src/clnplus.cpp
+++ b/plugins/Clist_nicer/src/clnplus.cpp
@@ -4,34 +4,24 @@
#include <commonheaders.h>
#include <shobjidl.h>
+#include "msapi/comptr.h"
#define _CLN_GDIP
-
#undef Translate
void RemoveFromTaskBar(HWND hWnd)
{
- ITaskbarList *pTaskbarList = NULL;
-
- if (SUCCEEDED(CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList,
- (void **)(&pTaskbarList))) && pTaskbarList != NULL) {
- if (SUCCEEDED(pTaskbarList->HrInit())) {
- pTaskbarList->DeleteTab(hWnd);
- }
- pTaskbarList->Release();
- }
+ CComPtr<ITaskbarList> pTaskbarList;
+ if (SUCCEEDED(pTaskbarList.CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER)))
+ if (SUCCEEDED(pTaskbarList->HrInit()))
+ pTaskbarList->DeleteTab(hWnd);
}
void AddToTaskBar(HWND hWnd)
{
- ITaskbarList *pTaskbarList = NULL;
-
- if (SUCCEEDED(CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList,
- (void **)(&pTaskbarList))) && pTaskbarList != NULL) {
- if (SUCCEEDED(pTaskbarList->HrInit())) {
- pTaskbarList->AddTab(hWnd);
- }
- pTaskbarList->Release();
- }
+ CComPtr<ITaskbarList> pTaskbarList;
+ if (SUCCEEDED(pTaskbarList.CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER)))
+ if (SUCCEEDED(pTaskbarList->HrInit()))
+ pTaskbarList->AddTab(hWnd);
}