summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/clnplus.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-02 21:38:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-02 21:38:16 +0000
commit28f6bfdc3ea1f2d34a05855f0459caa96c8fe2b6 (patch)
tree094d89e84844aaebd9f86e89f4646fe956e5febb /plugins/Clist_nicer/src/clnplus.cpp
parent40b39cebd5aa00ee8150f84a2b7987b5595ef2fc (diff)
minor cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@13976 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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);
}