A simple, small calculator placed discreetly near the Windows Taskbar or anywhere on the screen
0

Configure Feed

Select the types of activity you want to include in your feed.

build: convert project from DeskBand DLL to standalone EXE (stub WinMain)

- Delete COM/DeskBand sources, .def, .rgs, .idl, Guids.h, MFC AboutDialog
- Rewrite vcxproj as Application (v143, SDK 26100, C++17, no MIDL)
- Remove REGISTRY .rgs reference from .rc
- Add stub App.cpp with wWinMain
- CalculatorWindow.cpp excluded from build until Task 10 rework

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Marco Maroni (Jul 14, 2026, 3:08 PM +0200) 78d95c64 4e71650c

+52 -1162
-41
AboutDialog.cpp
··· 1 - // AboutDialog.cpp : implementation file 2 - // 3 - 4 - #include "stdafx.h" 5 - #include "AboutDialog.h" 6 - #include "afxdialogex.h" 7 - 8 - 9 - // CAboutDialog dialog 10 - 11 - IMPLEMENT_DYNAMIC(CAboutDialog, CDialogEx) 12 - 13 - CAboutDialog::CAboutDialog(CWnd* pParent /*=NULL*/) 14 - : CDialogEx(CAboutDialog::IDD, pParent) 15 - { 16 - 17 - } 18 - 19 - CAboutDialog::~CAboutDialog() 20 - { 21 - } 22 - 23 - void CAboutDialog::DoDataExchange(CDataExchange* pDX) 24 - { 25 - CDialogEx::DoDataExchange(pDX); 26 - } 27 - 28 - 29 - BEGIN_MESSAGE_MAP(CAboutDialog, CDialogEx) 30 - ON_BN_CLICKED(IDOK, &CAboutDialog::OnBnClickedOk) 31 - END_MESSAGE_MAP() 32 - 33 - 34 - // CAboutDialog message handlers 35 - 36 - 37 - void CAboutDialog::OnBnClickedOk() 38 - { 39 - // TODO: Add your control notification handler code here 40 - CDialogEx::OnOK(); 41 - }
-23
AboutDialog.h
··· 1 - #pragma once 2 - 3 - 4 - // CAboutDialog dialog 5 - 6 - class CAboutDialog : public CDialogEx 7 - { 8 - DECLARE_DYNAMIC(CAboutDialog) 9 - 10 - public: 11 - CAboutDialog(CWnd* pParent = NULL); // standard constructor 12 - virtual ~CAboutDialog(); 13 - 14 - // Dialog Data 15 - enum { IDD = IDD_ABOUT }; 16 - 17 - protected: 18 - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 19 - 20 - DECLARE_MESSAGE_MAP() 21 - public: 22 - afx_msg void OnBnClickedOk(); 23 - };
+7
App.cpp
··· 1 + #include "stdafx.h" 2 + 3 + int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int) 4 + { 5 + MessageBox(NULL, L"Taskbar Calculator (stub)", L"TaskbarCalculator", MB_OK); 6 + return 0; 7 + }
-489
CalculatorDeskBand.cpp
··· 1 - #include "StdAfx.h" 2 - #include "CalculatorDeskBand.h" 3 - #include "Utils.h" 4 - 5 - //////////////////////////////////////////////////////////////////////////////// 6 - // 7 - const UINT IDM_SEPARATOR_OFFSET = 0; 8 - const UINT IDM_SETTINGS_OFFSET = 1; 9 - 10 - //const LPCTSTR SETTINGS_SECTION_DATEFORMAT = TEXT("DateFormatDB"); 11 - 12 - BOOL CALLBACK AboutDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 13 - 14 - //////////////////////////////////////////////////////////////////////////////// 15 - // CCalculatorDeskBand 16 - 17 - CCalculatorDeskBand::CCalculatorDeskBand() 18 - { 19 - } 20 - 21 - //////////////////////////////////////////////////////////////////////////////// 22 - // 23 - HRESULT CCalculatorDeskBand::FinalConstruct() 24 - { 25 - m_nBandID = 0; 26 - m_dwViewMode = DBIF_VIEWMODE_NORMAL; 27 - m_bRequiresSave = false; 28 - m_bCompositionEnabled = TRUE; 29 - 30 - return HandleShowRequest(); 31 - } 32 - 33 - void CCalculatorDeskBand::FinalRelease() 34 - { 35 - } 36 - 37 - HRESULT CCalculatorDeskBand::HandleShowRequest() 38 - { 39 - OLECHAR szAtom[MAX_GUID_STRING_LEN] = { 0 }; 40 - ::StringFromGUID2(CLSID_CalendarDeskBand, szAtom, MAX_GUID_STRING_LEN); 41 - 42 - HRESULT hr = S_OK; 43 - const ATOM show = ::GlobalFindAtomW(szAtom); 44 - 45 - if(show) 46 - { 47 - CComPtr<IBandSite> spBandSite; 48 - hr = spBandSite.CoCreateInstance(CLSID_TrayBandSiteService); 49 - 50 - if(SUCCEEDED(hr)) 51 - { 52 - LPUNKNOWN lpUnk = static_cast<IOleWindow*>(this); 53 - hr = spBandSite->AddBand(lpUnk); 54 - } 55 - 56 - ::GlobalDeleteAtom(show); 57 - } 58 - 59 - return hr; 60 - } 61 - 62 - HRESULT CCalculatorDeskBand::UpdateDeskband() 63 - { 64 - CComPtr<IInputObjectSite> spInputSite; 65 - HRESULT hr = GetSite(IID_IInputObjectSite, 66 - reinterpret_cast<void**>(&spInputSite)); 67 - 68 - if(SUCCEEDED(hr)) 69 - { 70 - CComQIPtr<IOleCommandTarget> spOleCmdTarget = spInputSite; 71 - 72 - if(spOleCmdTarget) 73 - { 74 - // m_nBandID must be `int' or bandID variant must be explicitly 75 - // set to VT_I4, otherwise IDeskBand::GetBandInfo won't 76 - // be called by the system. 77 - CComVariant bandID(m_nBandID); 78 - 79 - hr = spOleCmdTarget->Exec(&CGID_DeskBand, 80 - DBID_BANDINFOCHANGED, OLECMDEXECOPT_DODEFAULT, &bandID, NULL); 81 - ATLASSERT(SUCCEEDED(hr)); 82 - } 83 - } 84 - 85 - return hr; 86 - } 87 - 88 - //////////////////////////////////////////////////////////////////////////////// 89 - // IObjectWithSite 90 - 91 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::SetSite( 92 - /* [in] */ IUnknown *pUnkSite) 93 - { 94 - HRESULT hr = __super::SetSite(pUnkSite); 95 - 96 - if(SUCCEEDED(hr) && pUnkSite) // pUnkSite is NULL when band is being destroyed 97 - { 98 - CComQIPtr<IOleWindow> spOleWindow = pUnkSite; 99 - 100 - if(spOleWindow) 101 - { 102 - HWND hwndParent = NULL; 103 - hr = spOleWindow->GetWindow(&hwndParent); 104 - 105 - if(SUCCEEDED(hr)) 106 - { 107 - m_wndCalculator.Create(hwndParent, 108 - static_cast<IDeskBand*>(this), pUnkSite); 109 - 110 - if(!m_wndCalculator.IsWindow()) 111 - hr = E_FAIL; 112 - } 113 - } 114 - } 115 - 116 - return hr; 117 - } 118 - 119 - //////////////////////////////////////////////////////////////////////////////// 120 - // IInputObject 121 - 122 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::UIActivateIO( 123 - /* [in] */ BOOL fActivate, 124 - /* [unique][in] */ PMSG /*pMsg*/) 125 - { 126 - ATLTRACE(atlTraceCOM, 2, _T("IInputObject::UIActivateIO (%s)\n"), 127 - (fActivate ? _T("TRUE") : _T("FALSE"))); 128 - 129 - if(fActivate) 130 - m_wndCalculator.SetFocus(); 131 - 132 - return S_OK; 133 - } 134 - 135 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::HasFocusIO() 136 - { 137 - ATLTRACE(atlTraceCOM, 2, _T("IInputObject::HasFocusIO\n")); 138 - 139 - return (m_wndCalculator.HasFocus() ? S_OK : S_FALSE); 140 - } 141 - 142 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::TranslateAcceleratorIO( 143 - /* [in] */ PMSG /*pMsg*/) 144 - { 145 - ATLTRACE(atlTraceCOM, 2, _T("IInputObject::TranslateAcceleratorIO\n")); 146 - 147 - return S_FALSE; 148 - } 149 - 150 - //////////////////////////////////////////////////////////////////////////////// 151 - // IContextMenu 152 - 153 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::QueryContextMenu( 154 - /* [in] */ HMENU hMenu, 155 - /* [in] */ UINT indexMenu, 156 - /* [in] */ UINT idCmdFirst, 157 - /* [in] */ UINT /*idCmdLast*/, 158 - /* [in] */ UINT uFlags) 159 - { 160 - ATLTRACE(atlTraceCOM, 2, _T("IContextMenu::QueryContextMenu\n")); 161 - 162 - if(CMF_DEFAULTONLY & uFlags) 163 - return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0); 164 - 165 - // Add a seperator 166 - ::InsertMenu(hMenu, 167 - indexMenu, 168 - MF_SEPARATOR | MF_BYPOSITION, 169 - idCmdFirst + IDM_SEPARATOR_OFFSET, 0); 170 - 171 - // Add the new menu item 172 - CString sCaption; 173 - sCaption.LoadString(IDS_DESKBANDSETTINGS); 174 - 175 - ::InsertMenu(hMenu, 176 - indexMenu, 177 - MF_STRING | MF_BYPOSITION, 178 - idCmdFirst + IDM_SETTINGS_OFFSET, 179 - sCaption); 180 - 181 - return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, IDM_SETTINGS_OFFSET + 1); 182 - } 183 - 184 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::InvokeCommand( 185 - LPCMINVOKECOMMANDINFO pici) 186 - { 187 - ATLTRACE(atlTraceCOM, 2, _T("IContextMenu::InvokeCommand\n")); 188 - 189 - if(!pici) return E_INVALIDARG; 190 - 191 - if(LOWORD(pici->lpVerb) == IDM_SETTINGS_OFFSET) 192 - { 193 - ATLASSERT(m_wndCalculator.IsWindow()); 194 - 195 - INT_PTR i = DialogBox(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDD_ABOUT), pici->hwnd, (DLGPROC)AboutDialogProc); 196 - if (i == -1) 197 - { 198 - DWORD lastError = GetLastError(); 199 - ATLTRACE(atlTraceWindowing, 1, "%d", lastError); 200 - } 201 - 202 - //CDateFormatSettings dlgSettings; 203 - //const INT_PTR res = dlgSettings.DoModal(m_wndCalculator, 204 - // reinterpret_cast<LPARAM>(&m_dateFormat)); 205 - 206 - //if(res == IDOK) 207 - //{ 208 - // m_dateFormat = dlgSettings.m_dateFormat; 209 - // m_bRequiresSave = true; 210 - // 211 - // const HRESULT hr = UpdateDeskband(); 212 - // ATLASSERT(SUCCEEDED(hr)); 213 - //} 214 - } 215 - 216 - return S_OK; 217 - } 218 - 219 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::GetCommandString( 220 - /* [in] */ UINT_PTR /*idCmd*/, 221 - /* [in] */ UINT /*uType*/, 222 - /* [in] */ UINT* /*pReserved*/, 223 - /* [out] */ LPSTR /*pszName*/, 224 - /* [in] */ UINT /*cchMax*/) 225 - { 226 - ATLTRACE(atlTraceCOM, 2, _T("IContextMenu::GetCommandString\n")); 227 - 228 - return S_OK; 229 - } 230 - 231 - //////////////////////////////////////////////////////////////////////////////// 232 - // IDeskBand 233 - 234 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::GetBandInfo( 235 - /* [in] */ DWORD dwBandID, 236 - /* [in] */ DWORD dwViewMode, 237 - /* [out][in] */ DESKBANDINFO *pdbi) 238 - { 239 - ATLTRACE(atlTraceCOM, 2, _T("IDeskBand::GetBandInfo\n")); 240 - 241 - if(!pdbi) return E_INVALIDARG; 242 - 243 - m_nBandID = dwBandID; 244 - m_dwViewMode = dwViewMode; 245 - 246 - if(pdbi->dwMask & DBIM_MODEFLAGS) 247 - { 248 - pdbi->dwModeFlags = DBIMF_VARIABLEHEIGHT; 249 - } 250 - 251 - if(pdbi->dwMask & DBIM_MINSIZE) 252 - { 253 - pdbi->ptMinSize = m_wndCalculator.CalcIdealSize(); 254 - } 255 - 256 - if(pdbi->dwMask & DBIM_MAXSIZE) 257 - { 258 - // the band object has no limit for its maximum height 259 - pdbi->ptMaxSize.x = -1; 260 - pdbi->ptMaxSize.y = -1; 261 - } 262 - 263 - if(pdbi->dwMask & DBIM_INTEGRAL) 264 - { 265 - pdbi->ptIntegral.x = 1; 266 - pdbi->ptIntegral.y = 1; 267 - } 268 - 269 - if(pdbi->dwMask & DBIM_ACTUAL) 270 - { 271 - pdbi->ptActual = m_wndCalculator.CalcIdealSize(); 272 - } 273 - 274 - if(pdbi->dwMask & DBIM_TITLE) 275 - { 276 - CString stringCaption; 277 - stringCaption.LoadString(IDS_TASKBARCALCULATOR); 278 - lstrcpynW(pdbi->wszTitle, stringCaption, ARRAYSIZE(pdbi->wszTitle)); 279 - } 280 - 281 - if(pdbi->dwMask & DBIM_BKCOLOR) 282 - { 283 - //Use the default background color by removing this flag. 284 - pdbi->dwMask &= ~DBIM_BKCOLOR; 285 - } 286 - 287 - return S_OK; 288 - } 289 - 290 - //////////////////////////////////////////////////////////////////////////////// 291 - // IDeskBand2 292 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::CanRenderComposited( 293 - /* [out] */ BOOL *pfCanRenderComposited) 294 - { 295 - if(pfCanRenderComposited) 296 - *pfCanRenderComposited = TRUE; 297 - 298 - return S_OK; 299 - } 300 - 301 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::SetCompositionState( 302 - /* [in] */ BOOL fCompositionEnabled) 303 - { 304 - m_bCompositionEnabled = fCompositionEnabled; 305 - m_wndCalculator.Invalidate(); 306 - 307 - return S_OK; 308 - } 309 - 310 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::GetCompositionState( 311 - /* [out] */ BOOL *pfCompositionEnabled) 312 - { 313 - if(pfCompositionEnabled) 314 - *pfCompositionEnabled = m_bCompositionEnabled; 315 - 316 - return S_OK; 317 - } 318 - 319 - //////////////////////////////////////////////////////////////////////////////// 320 - // IOleWindow 321 - 322 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::GetWindow( 323 - /* [out] */ HWND *phwnd) 324 - { 325 - ATLTRACE(atlTraceCOM, 2, _T("IOleWindow::GetWindow\n")); 326 - 327 - if(phwnd) *phwnd = m_wndCalculator; 328 - 329 - return S_OK; 330 - } 331 - 332 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::ContextSensitiveHelp( 333 - /* [in] */ BOOL /*fEnterMode*/) 334 - { 335 - ATLTRACE(atlTraceCOM, 2, _T("IOleWindow::ContextSensitiveHelp\n")); 336 - 337 - //ATLTRACENOTIMPL(_T("IOleWindow::ContextSensitiveHelp")); 338 - return S_OK; 339 - } 340 - 341 - //////////////////////////////////////////////////////////////////////////////// 342 - // IDockingWindow 343 - 344 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::ShowDW( 345 - /* [in] */ BOOL fShow) 346 - { 347 - ATLTRACE(atlTraceCOM, 2, _T("IDockingWindow::ShowDW\n")); 348 - 349 - if(m_wndCalculator) 350 - m_wndCalculator.ShowWindow(fShow ? SW_SHOW : SW_HIDE); 351 - 352 - return S_OK; 353 - } 354 - 355 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::CloseDW( 356 - /* [in] */ DWORD /*dwReserved*/) 357 - { 358 - ATLTRACE(atlTraceCOM, 2, _T("IDockingWindow::CloseDW\n")); 359 - 360 - if(m_wndCalculator) 361 - { 362 - m_wndCalculator.ShowWindow(SW_HIDE); 363 - m_wndCalculator.DestroyWindow(); 364 - } 365 - 366 - return S_OK; 367 - } 368 - 369 - HRESULT STDMETHODCALLTYPE CCalculatorDeskBand::ResizeBorderDW( 370 - /* [in] */ LPCRECT prcBorder, 371 - /* [in] */ IUnknown *punkToolbarSite, 372 - /* [in] */ BOOL /*fReserved*/) 373 - { 374 - ATLTRACE(atlTraceCOM, 2, _T("IDockingWindow::ResizeBorderDW\n")); 375 - 376 - if(!m_wndCalculator) return S_OK; 377 - 378 - CComQIPtr<IDockingWindowSite> spDockingWindowSite = punkToolbarSite; 379 - 380 - if(spDockingWindowSite) 381 - { 382 - BORDERWIDTHS bw = { 0 }; 383 - bw.top = bw.bottom = ::GetSystemMetrics(SM_CYBORDER); 384 - bw.left = bw.right = ::GetSystemMetrics(SM_CXBORDER); 385 - 386 - HRESULT hr = spDockingWindowSite->RequestBorderSpaceDW( 387 - static_cast<IDeskBand*>(this), &bw); 388 - 389 - if(SUCCEEDED(hr)) 390 - { 391 - HRESULT hr2 = spDockingWindowSite->SetBorderSpaceDW( 392 - static_cast<IDeskBand*>(this), &bw); 393 - 394 - if(SUCCEEDED(hr2)) 395 - { 396 - m_wndCalculator.MoveWindow(prcBorder); 397 - return S_OK; 398 - } 399 - } 400 - } 401 - 402 - return E_FAIL; 403 - } 404 - 405 - //////////////////////////////////////////////////////////////////////////////// 406 - // IPersistStreamImpl 407 - 408 - HRESULT CCalculatorDeskBand::IPersistStreamInit_Load( 409 - LPSTREAM pStm, 410 - const ATL_PROPMAP_ENTRY* pMap) 411 - { 412 - //if(m_bstrDateFormat) 413 - // m_bstrDateFormat.Empty(); 414 - 415 - const HRESULT hr = __super::IPersistStreamInit_Load(pStm, pMap); 416 - 417 - //if(SUCCEEDED(hr)) 418 - // m_dateFormat.dateFormat = m_bstrDateFormat; 419 - 420 - return hr; 421 - } 422 - 423 - HRESULT CCalculatorDeskBand::IPersistStreamInit_Save( 424 - LPSTREAM pStm, 425 - BOOL fClearDirty, 426 - const ATL_PROPMAP_ENTRY* pMap) 427 - { 428 - // m_bstrDateFormat = m_dateFormat.dateFormat; 429 - 430 - return __super::IPersistStreamInit_Save(pStm, fClearDirty, pMap); 431 - } 432 - 433 - //////////////////////////////////////////////////////////////////////////////// 434 - 435 - 436 - /************************************************************************** 437 - 438 - AboutDialogProc() 439 - 440 - **************************************************************************/ 441 - 442 - BOOL CALLBACK AboutDialogProc( 443 - HWND hwndDlg, // handle to dialog box 444 - UINT uMsg, // message 445 - WPARAM wParam, // first message parameter 446 - LPARAM lParam // second message parameter 447 - ) 448 - { 449 - 450 - switch (uMsg) 451 - { 452 - case WM_INITDIALOG: 453 - break; 454 - case WM_NOTIFY: 455 - switch (((LPNMHDR)lParam)->code) 456 - { 457 - case NM_CLICK: // Fall through to the next case. 458 - case NM_RETURN: 459 - { 460 - PNMLINK pNMLink = (PNMLINK)lParam; 461 - LITEM item = pNMLink->item; 462 - if (item.iLink == 0) 463 - { 464 - ShellExecute(NULL, L"open", item.szUrl, NULL, NULL, SW_SHOW); 465 - } 466 - break; 467 - } 468 - } 469 - break; 470 - case WM_COMMAND: 471 - switch (LOWORD(wParam)) 472 - { 473 - case IDOK: 474 - case IDCANCEL: 475 - EndDialog(hwndDlg, TRUE); 476 - return TRUE; 477 - break; 478 - 479 - default: 480 - break; 481 - } 482 - break; 483 - } 484 - 485 - return FALSE; 486 - } 487 - 488 - 489 -
-160
CalculatorDeskBand.h
··· 1 - // CalendarDeskBand.h : Declaration of the CCalculatorDeskBand 2 - 3 - #pragma once 4 - #include "resource.h" // main symbols 5 - 6 - #include "Guids.h" 7 - #include "CalculatorWindow.h" 8 - 9 - #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) 10 - #error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." 11 - #endif 12 - 13 - using namespace ATL; 14 - 15 - class CCalculatorDeskBand : 16 - public CComObjectRootEx<CComSingleThreadModel>, 17 - public CComCoClass<CCalculatorDeskBand, &CLSID_CalendarDeskBand>, 18 - public IObjectWithSiteImpl<CCalculatorDeskBand>, 19 - public IPersistStreamInitImpl<CCalculatorDeskBand>, 20 - public IInputObject, 21 - public IContextMenu, 22 - public IDeskBand2 23 - { 24 - typedef IPersistStreamInitImpl<CCalculatorDeskBand> IPersistStreamImpl; 25 - public: 26 - CCalculatorDeskBand(); 27 - 28 - DECLARE_REGISTRY_RESOURCEID(IDR_TASKBARCALCULATOR) 29 - 30 - BEGIN_COM_MAP(CCalculatorDeskBand) 31 - COM_INTERFACE_ENTRY(IOleWindow) 32 - COM_INTERFACE_ENTRY(IDockingWindow) 33 - COM_INTERFACE_ENTRY(IDeskBand) 34 - COM_INTERFACE_ENTRY(IDeskBand2) 35 - COM_INTERFACE_ENTRY(IInputObject) 36 - COM_INTERFACE_ENTRY(IContextMenu) 37 - COM_INTERFACE_ENTRY(IObjectWithSite) 38 - COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersistStreamImpl) 39 - COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStreamImpl) 40 - COM_INTERFACE_ENTRY_IID(IID_IPersistStreamInit, IPersistStreamImpl) 41 - END_COM_MAP() 42 - 43 - BEGIN_CATEGORY_MAP(CCalculatorDeskBand) 44 - IMPLEMENTED_CATEGORY(CATID_DeskBand) 45 - END_CATEGORY_MAP() 46 - 47 - // IPersistStreamInitImpl requires property map. 48 - BEGIN_PROP_MAP(CCalculatorDeskBand) 49 - //PROP_DATA_ENTRY("Locale", m_dateFormat.lcId, VT_UI4) 50 - //PROP_DATA_ENTRY("Calendar", m_dateFormat.calId, VT_UI4) 51 - //PROP_DATA_ENTRY("CalendarType", m_dateFormat.calType, VT_UI4) 52 - //PROP_DATA_ENTRY("DateFormat", m_bstrDateFormat.m_str, VT_BSTR) 53 - END_PROP_MAP() 54 - 55 - DECLARE_PROTECT_FINAL_CONSTRUCT() 56 - 57 - HRESULT FinalConstruct(); 58 - void FinalRelease(); 59 - 60 - public: 61 - // IObjectWithSite 62 - // 63 - STDMETHOD(SetSite)( 64 - /* [in] */ IUnknown *pUnkSite); 65 - 66 - // IInputObject 67 - // 68 - STDMETHOD(UIActivateIO)( 69 - /* [in] */ BOOL fActivate, 70 - /* [unique][in] */ MSG *pMsg); 71 - 72 - STDMETHOD(HasFocusIO)(); 73 - 74 - STDMETHOD(TranslateAcceleratorIO)( 75 - /* [in] */ MSG *pMsg); 76 - 77 - // IContextMenu 78 - // 79 - STDMETHOD(QueryContextMenu)( 80 - /* [in] */ HMENU hmenu, 81 - /* [in] */ UINT indexMenu, 82 - /* [in] */ UINT idCmdFirst, 83 - /* [in] */ UINT idCmdLast, 84 - /* [in] */ UINT uFlags); 85 - 86 - STDMETHOD(InvokeCommand)( 87 - /* [in] */ CMINVOKECOMMANDINFO *pici); 88 - 89 - STDMETHOD(GetCommandString)( 90 - /* [in] */ UINT_PTR idCmd, 91 - /* [in] */ UINT uType, 92 - /* [in] */ UINT *pReserved, 93 - /* [out] */ LPSTR pszName, 94 - /* [in] */ UINT cchMax); 95 - 96 - // IDeskBand 97 - // 98 - STDMETHOD(GetBandInfo)( 99 - /* [in] */ DWORD dwBandID, 100 - /* [in] */ DWORD dwViewMode, 101 - /* [out][in] */ DESKBANDINFO *pdbi); 102 - 103 - // IDeskBand2 104 - // 105 - STDMETHOD(CanRenderComposited)( 106 - /* [out] */ BOOL *pfCanRenderComposited); 107 - 108 - STDMETHOD(SetCompositionState)( 109 - /* [in] */ BOOL fCompositionEnabled); 110 - 111 - STDMETHOD(GetCompositionState)( 112 - /* [out] */ BOOL *pfCompositionEnabled); 113 - 114 - // IOleWindow 115 - // 116 - STDMETHOD(GetWindow)( 117 - /* [out] */ HWND *phwnd); 118 - 119 - STDMETHOD(ContextSensitiveHelp)( 120 - /* [in] */ BOOL fEnterMode); 121 - 122 - // IDockingWindow 123 - // 124 - STDMETHOD(ShowDW)( 125 - /* [in] */ BOOL fShow); 126 - 127 - STDMETHOD(CloseDW)( 128 - /* [in] */ DWORD dwReserved); 129 - 130 - STDMETHOD(ResizeBorderDW)( 131 - /* [in] */ LPCRECT prcBorder, 132 - /* [in] */ IUnknown *punkToolbarSite, 133 - /* [in] */ BOOL fReserved); 134 - 135 - // IPersistStreamImpl 136 - // 137 - HRESULT IPersistStreamInit_Load( 138 - /* [in] */ LPSTREAM pStm, 139 - /* [in] */ const ATL_PROPMAP_ENTRY* pMap); 140 - 141 - HRESULT IPersistStreamInit_Save( 142 - /* [in] */ LPSTREAM pStm, 143 - /* [in] */ BOOL fClearDirty, 144 - /* [in] */ const ATL_PROPMAP_ENTRY* pMap); 145 - 146 - private: 147 - HRESULT HandleShowRequest(); 148 - HRESULT UpdateDeskband(); 149 - 150 - public: 151 - bool m_bRequiresSave; // used by IPersistStreamInitImpl 152 - 153 - private: 154 - int m_nBandID; 155 - DWORD m_dwViewMode; 156 - CCalculatorWindow m_wndCalculator; 157 - BOOL m_bCompositionEnabled; 158 - }; 159 - 160 - OBJECT_ENTRY_AUTO(CLSID_CalendarDeskBand, CCalculatorDeskBand)
-13
DllMain.cpp
··· 1 - // dllmain.cpp : Implementation of DllMain. 2 - 3 - #include "StdAfx.h" 4 - #include "DllMain.h" 5 - 6 - CCalculatorDeskBandModule _AtlModule; 7 - 8 - // DLL Entry Point 9 - extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) 10 - { 11 - hInstance; 12 - return _AtlModule.DllMain(dwReason, lpReserved); 13 - }
-12
DllMain.h
··· 1 - // dllmain.h : Declaration of module class. 2 - 3 - using namespace ATL; 4 - 5 - class CCalculatorDeskBandModule : public CAtlDllModuleT< CCalculatorDeskBandModule > 6 - { 7 - public : 8 - //DECLARE_LIBID(LIBID_CalendarDeskBandLib) 9 - //DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CALENDARDESKBAND, "{F5CD352C-35E7-4EE6-B924-3C0486A6CBBA}") 10 - }; 11 - 12 - extern class CCalculatorDeskBandModule _AtlModule;
-11
Guids.h
··· 1 - #pragma once 2 - 3 - //////////////////////////////////////////////////////////////////////////////// 4 - // 5 - const size_t MAX_GUID_STRING_LEN = 39; 6 - 7 - extern const __declspec(selectany) CLSID CLSID_CalendarDeskBand = 8 - { 0x1B1E01F4, 0x6B08, 0x44F9, { 0xA1,0xE8,0x40,0xBC,0x40,0xB5,0x55,0x78 }}; 9 - 10 - //////////////////////////////////////////////////////////////////////////////// 11 -
-10
TaskbarCalculator.def
··· 1 - ; TaskbarCalculator.def : Declares the module parameters. 2 - 3 - LIBRARY "TaskbarCalculator.DLL" 4 - 5 - EXPORTS 6 - DllCanUnloadNow PRIVATE 7 - DllGetClassObject PRIVATE 8 - DllRegisterServer PRIVATE 9 - DllUnregisterServer PRIVATE 10 - DllInstall PRIVATE
-25
TaskbarCalculator.idl
··· 1 - // CalendarDeskBand.idl : IDL source for CalendarDeskBand 2 - // 3 - 4 - // This file will be processed by the MIDL tool to 5 - // produce the type library (CalendarDeskBand.tlb) and marshalling code. 6 - 7 - [ 8 - uuid(33EB8C00-F66A-493C-8607-529060FAA378), 9 - version(1.0), 10 - helpstring("CalendarDeskBand 1.0 Type Library") 11 - ] 12 - library CalendarDeskBandLib 13 - { 14 - importlib("stdole2.tlb"); 15 - [ 16 - uuid(1B1E01F4-6B08-44F9-A1E8-40BC40B55578), 17 - helpstring("CalendarDeskBand Class") 18 - ] 19 - coclass CalendarDeskBand 20 - { 21 - [default] interface IUnknown; 22 - }; 23 - 24 - cpp_quote("const size_t MAX_GUID_STRING_LEN = 39;") 25 - };
TaskbarCalculator.rc

This is a binary file and will not be displayed.

-13
TaskbarCalculator.rgs
··· 1 - HKCR 2 - { 3 - NoRemove CLSID 4 - { 5 - ForceRemove {1B1E01F4-6B08-44F9-A1E8-40BC40B55578} = s 'Taskbar Calculator' 6 - { 7 - InprocServer32 = s '%MODULE%' 8 - { 9 - val ThreadingModel = s 'Apartment' 10 - } 11 - } 12 - } 13 - }
+26 -218
TaskbarCalculator.vcxproj
··· 1 - <?xml version="1.0" encoding="utf-8"?> 2 - <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1 + <?xml version="1.0" encoding="utf-8"?> 2 + <Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 3 <ItemGroup Label="ProjectConfigurations"> 4 4 <ProjectConfiguration Include="Debug|Win32"> 5 5 <Configuration>Debug</Configuration> ··· 23 23 <RootNamespace>TaskbarCalculator</RootNamespace> 24 24 <Keyword>AtlProj</Keyword> 25 25 <ProjectName>TaskbarCalculator</ProjectName> 26 - <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> 26 + <WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion> 27 27 </PropertyGroup> 28 28 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> 29 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> 30 - <ConfigurationType>DynamicLibrary</ConfigurationType> 31 - <PlatformToolset>v141</PlatformToolset> 29 + <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> 30 + <ConfigurationType>Application</ConfigurationType> 31 + <PlatformToolset>v143</PlatformToolset> 32 32 <UseOfAtl>Static</UseOfAtl> 33 33 <CharacterSet>Unicode</CharacterSet> 34 34 <WholeProgramOptimization>true</WholeProgramOptimization> 35 35 </PropertyGroup> 36 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> 37 - <ConfigurationType>DynamicLibrary</ConfigurationType> 38 - <PlatformToolset>v141</PlatformToolset> 39 - <UseOfAtl>Static</UseOfAtl> 40 - <CharacterSet>Unicode</CharacterSet> 41 - </PropertyGroup> 42 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> 43 - <ConfigurationType>DynamicLibrary</ConfigurationType> 44 - <PlatformToolset>v141</PlatformToolset> 45 - <UseOfAtl>Static</UseOfAtl> 46 - <CharacterSet>Unicode</CharacterSet> 47 - <WholeProgramOptimization>true</WholeProgramOptimization> 48 - </PropertyGroup> 49 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> 50 - <ConfigurationType>DynamicLibrary</ConfigurationType> 51 - <PlatformToolset>v141</PlatformToolset> 36 + <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> 37 + <ConfigurationType>Application</ConfigurationType> 38 + <PlatformToolset>v143</PlatformToolset> 52 39 <UseOfAtl>Static</UseOfAtl> 53 40 <CharacterSet>Unicode</CharacterSet> 54 41 </PropertyGroup> 55 42 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> 56 43 <ImportGroup Label="ExtensionSettings"> 57 44 </ImportGroup> 58 - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> 59 - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 60 - </ImportGroup> 61 - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> 62 - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 63 - </ImportGroup> 64 - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> 65 - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 66 - </ImportGroup> 67 - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> 45 + <ImportGroup Label="PropertySheets"> 68 46 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 69 47 </ImportGroup> 70 48 <PropertyGroup Label="UserMacros" /> 71 49 <PropertyGroup> 72 - <_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion> 73 - </PropertyGroup> 74 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 75 50 <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> 76 51 <IntDir>$(Platform)\$(Configuration)\</IntDir> 77 - <IgnoreImportLibrary>true</IgnoreImportLibrary> 78 - <LinkIncremental>true</LinkIncremental> 79 52 </PropertyGroup> 80 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 81 - <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> 82 - <IntDir>$(Platform)\$(Configuration)\</IntDir> 83 - <IgnoreImportLibrary>true</IgnoreImportLibrary> 53 + <PropertyGroup Condition="'$(Configuration)'=='Debug'"> 84 54 <LinkIncremental>true</LinkIncremental> 85 - <CodeAnalysisRuleSet>NativeMinimumRules.ruleset</CodeAnalysisRuleSet> 86 55 </PropertyGroup> 87 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> 88 - <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> 89 - <IntDir>$(Platform)\$(Configuration)\</IntDir> 90 - <IgnoreImportLibrary>true</IgnoreImportLibrary> 91 - <LinkIncremental>false</LinkIncremental> 92 - </PropertyGroup> 93 - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> 94 - <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> 95 - <IntDir>$(Platform)\$(Configuration)\</IntDir> 96 - <IgnoreImportLibrary>true</IgnoreImportLibrary> 56 + <PropertyGroup Condition="'$(Configuration)'=='Release'"> 97 57 <LinkIncremental>false</LinkIncremental> 98 58 </PropertyGroup> 99 - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 100 - <Midl> 101 - <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 102 - <MkTypLibCompatible>false</MkTypLibCompatible> 103 - <TargetEnvironment>Win32</TargetEnvironment> 104 - <GenerateStublessProxies>true</GenerateStublessProxies> 105 - <GenerateTypeLibrary>false</GenerateTypeLibrary> 106 - <TypeLibraryName>TaskbarCalculator.tlb</TypeLibraryName> 107 - <OutputDirectory>$(SolutionDir)Common</OutputDirectory> 108 - <HeaderFileName>TaskbarCalculator_i.h</HeaderFileName> 109 - <DllDataFileName /> 110 - <InterfaceIdentifierFileName>TaskbarCalculator_i.c</InterfaceIdentifierFileName> 111 - <ProxyFileName>TaskbarCalculator_p.c</ProxyFileName> 112 - <ValidateAllParameters>true</ValidateAllParameters> 113 - </Midl> 59 + <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> 114 60 <ClCompile> 115 61 <Optimization>Disabled</Optimization> 116 - <AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 117 - <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> 118 - <MinimalRebuild>true</MinimalRebuild> 119 - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> 120 - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> 121 - <PrecompiledHeader>Use</PrecompiledHeader> 122 - <BrowseInformation>true</BrowseInformation> 123 - <WarningLevel>Level4</WarningLevel> 124 - <DebugInformationFormat>EditAndContinue</DebugInformationFormat> 125 - </ClCompile> 126 - <ResourceCompile> 127 - <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 128 - <Culture>0x0409</Culture> 129 - <AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 130 - </ResourceCompile> 131 - <Link> 132 - <ModuleDefinitionFile>.\TaskbarCalculator.def</ModuleDefinitionFile> 133 - <GenerateDebugInformation>true</GenerateDebugInformation> 134 - <SubSystem>Windows</SubSystem> 135 - <TargetMachine>MachineX86</TargetMachine> 136 - </Link> 137 - </ItemDefinitionGroup> 138 - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 139 - <Midl> 140 - <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 141 - <MkTypLibCompatible>false</MkTypLibCompatible> 142 - <TargetEnvironment>X64</TargetEnvironment> 143 - <GenerateStublessProxies>true</GenerateStublessProxies> 144 - <GenerateTypeLibrary>false</GenerateTypeLibrary> 145 - <TypeLibraryName>TaskbarCalculator.tlb</TypeLibraryName> 146 - <OutputDirectory>$(SolutionDir)Common</OutputDirectory> 147 - <HeaderFileName>TaskbarCalculator_i.h</HeaderFileName> 148 - <DllDataFileName /> 149 - <InterfaceIdentifierFileName>TaskbarCalculator_i.c</InterfaceIdentifierFileName> 150 - <ProxyFileName>TaskbarCalculator_p.c</ProxyFileName> 151 - </Midl> 152 - <ClCompile> 153 - <Optimization>Disabled</Optimization> 154 - <AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 155 - <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> 156 - <MinimalRebuild>true</MinimalRebuild> 157 - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> 62 + <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 158 63 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> 159 64 <PrecompiledHeader>Use</PrecompiledHeader> 160 - <BrowseInformation>true</BrowseInformation> 161 - <WarningLevel>Level4</WarningLevel> 162 - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> 163 - </ClCompile> 164 - <ResourceCompile> 165 - <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 166 - <Culture>0x0409</Culture> 167 - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 168 - </ResourceCompile> 169 - <Link> 170 - <ModuleDefinitionFile>.\TaskbarCalculator.def</ModuleDefinitionFile> 171 - <GenerateDebugInformation>true</GenerateDebugInformation> 172 - <SubSystem>Windows</SubSystem> 173 - <TargetMachine>MachineX64</TargetMachine> 174 - </Link> 175 - </ItemDefinitionGroup> 176 - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> 177 - <Midl> 178 - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 179 - <MkTypLibCompatible>false</MkTypLibCompatible> 180 - <TargetEnvironment>Win32</TargetEnvironment> 181 - <GenerateStublessProxies>true</GenerateStublessProxies> 182 - <GenerateTypeLibrary>false</GenerateTypeLibrary> 183 - <TypeLibraryName>TaskbarCalculator.tlb</TypeLibraryName> 184 - <OutputDirectory>$(SolutionDir)Common</OutputDirectory> 185 - <HeaderFileName>TaskbarCalculator_i.h</HeaderFileName> 186 - <DllDataFileName /> 187 - <InterfaceIdentifierFileName>TaskbarCalculator_i.c</InterfaceIdentifierFileName> 188 - <ProxyFileName>TaskbarCalculator_p.c</ProxyFileName> 189 - <ValidateAllParameters>true</ValidateAllParameters> 190 - </Midl> 191 - <ClCompile> 192 - <Optimization>Full</Optimization> 193 - <IntrinsicFunctions>true</IntrinsicFunctions> 194 - <WholeProgramOptimization>true</WholeProgramOptimization> 195 - <AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 196 - <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> 197 - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> 198 - <PrecompiledHeader>Use</PrecompiledHeader> 65 + <PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> 66 + <LanguageStandard>stdcpp17</LanguageStandard> 199 67 <WarningLevel>Level3</WarningLevel> 200 68 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> 201 69 </ClCompile> 202 - <ResourceCompile> 203 - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 204 - <Culture>0x0409</Culture> 205 - <AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 206 - </ResourceCompile> 207 70 <Link> 208 - <ModuleDefinitionFile>.\TaskbarCalculator.def</ModuleDefinitionFile> 209 71 <GenerateDebugInformation>true</GenerateDebugInformation> 210 72 <SubSystem>Windows</SubSystem> 211 - <OptimizeReferences>true</OptimizeReferences> 212 - <EnableCOMDATFolding>true</EnableCOMDATFolding> 213 - <TargetMachine>MachineX86</TargetMachine> 214 73 </Link> 215 74 </ItemDefinitionGroup> 216 - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> 217 - <Midl> 218 - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 219 - <MkTypLibCompatible>false</MkTypLibCompatible> 220 - <TargetEnvironment>X64</TargetEnvironment> 221 - <GenerateStublessProxies>true</GenerateStublessProxies> 222 - <GenerateTypeLibrary>false</GenerateTypeLibrary> 223 - <TypeLibraryName>TaskbarCalculator.tlb</TypeLibraryName> 224 - <OutputDirectory>$(SolutionDir)Common</OutputDirectory> 225 - <HeaderFileName>TaskbarCalculator_i.h</HeaderFileName> 226 - <DllDataFileName /> 227 - <InterfaceIdentifierFileName>TaskbarCalculator_i.c</InterfaceIdentifierFileName> 228 - <ProxyFileName>TaskbarCalculator_p.c</ProxyFileName> 229 - </Midl> 75 + <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> 230 76 <ClCompile> 231 77 <Optimization>Full</Optimization> 232 78 <IntrinsicFunctions>true</IntrinsicFunctions> 233 79 <WholeProgramOptimization>true</WholeProgramOptimization> 234 - <AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 235 - <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> 80 + <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 236 81 <RuntimeLibrary>MultiThreaded</RuntimeLibrary> 237 82 <PrecompiledHeader>Use</PrecompiledHeader> 83 + <PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> 84 + <LanguageStandard>stdcpp17</LanguageStandard> 238 85 <WarningLevel>Level3</WarningLevel> 239 86 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> 240 87 </ClCompile> 241 - <ResourceCompile> 242 - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> 243 - <Culture>0x0409</Culture> 244 - <AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 245 - </ResourceCompile> 246 88 <Link> 247 - <ModuleDefinitionFile>.\TaskbarCalculator.def</ModuleDefinitionFile> 248 89 <GenerateDebugInformation>true</GenerateDebugInformation> 249 90 <SubSystem>Windows</SubSystem> 250 91 <OptimizeReferences>true</OptimizeReferences> 251 92 <EnableCOMDATFolding>true</EnableCOMDATFolding> 252 - <TargetMachine>MachineX64</TargetMachine> 253 93 </Link> 254 94 </ItemDefinitionGroup> 255 95 <ItemGroup> 96 + <ClCompile Include="App.cpp" /> 256 97 <ClCompile Include="Calculator.cpp"> 257 98 <PrecompiledHeader>NotUsing</PrecompiledHeader> 258 99 </ClCompile> 259 - <ClCompile Include="CalculatorDeskBand.cpp" /> 260 - <ClCompile Include="TaskbarCalculatorDeskBandDll.cpp" /> 261 - <ClCompile Include="CalculatorWindow.cpp" /> 262 - <ClCompile Include="DllMain.cpp"> 263 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 264 - </PrecompiledHeader> 265 - <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged> 266 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 267 - </PrecompiledHeader> 268 - <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged> 269 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> 270 - </PrecompiledHeader> 271 - <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged> 272 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> 273 - </PrecompiledHeader> 274 - <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged> 275 - </ClCompile> 100 + <ClCompile Include="Utils.cpp" /> 101 + <ClCompile Include="VisualStyle.cpp" /> 276 102 <ClCompile Include="stdafx.cpp"> 277 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> 278 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> 279 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> 280 - <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> 103 + <PrecompiledHeader>Create</PrecompiledHeader> 281 104 </ClCompile> 282 - <ClCompile Include="Utils.cpp" /> 283 - <ClCompile Include="VisualStyle.cpp" /> 284 - </ItemGroup> 285 - <ItemGroup> 286 - <None Include="TaskbarCalculator.def" /> 287 - <None Include="TaskbarCalculator.rgs" /> 288 105 </ItemGroup> 289 106 <ItemGroup> 290 107 <ClInclude Include="Calculator.h" /> 291 - <ClInclude Include="CalculatorDeskBand.h" /> 292 108 <ClInclude Include="CalculatorWindow.h" /> 293 - <ClInclude Include="DateFormatSettingsRes.h" /> 294 - <ClInclude Include="DllMain.h" /> 295 - <ClInclude Include="Guids.h" /> 296 - <ClInclude Include="Resource.h" /> 109 + <ClInclude Include="resource.h" /> 297 110 <ClInclude Include="stdafx.h" /> 298 111 <ClInclude Include="targetver.h" /> 299 112 <ClInclude Include="Utils.h" /> ··· 308 121 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> 309 122 <ImportGroup Label="ExtensionTargets"> 310 123 </ImportGroup> 311 - <ProjectExtensions> 312 - <VisualStudio> 313 - <UserProperties RESOURCE_FILE="TaskbarCalculator.rc" /> 314 - </VisualStudio> 315 - </ProjectExtensions> 316 - </Project> 124 + </Project>
+19 -80
TaskbarCalculator.vcxproj.filters
··· 1 - <?xml version="1.0" encoding="utf-8"?> 1 + <?xml version="1.0" encoding="utf-8"?> 2 2 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 3 <ItemGroup> 4 4 <Filter Include="Source Files"> 5 5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> 6 - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> 6 + <Extensions>cpp;c;cc;cxx</Extensions> 7 7 </Filter> 8 8 <Filter Include="Header Files"> 9 9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> 10 - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> 10 + <Extensions>h;hpp;hxx</Extensions> 11 11 </Filter> 12 12 <Filter Include="Resource Files"> 13 13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> 14 - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> 15 - </Filter> 16 - <Filter Include="Generated Files"> 17 - <UniqueIdentifier>{7fe65bbb-c699-4ce1-8508-3dd5ce94ffd7}</UniqueIdentifier> 18 - <SourceControlFiles>False</SourceControlFiles> 14 + <Extensions>rc;ico;cur;bmp;dlg;rgs;bin</Extensions> 19 15 </Filter> 20 16 </ItemGroup> 21 17 <ItemGroup> 22 - <ClCompile Include="DllMain.cpp"> 23 - <Filter>Source Files</Filter> 24 - </ClCompile> 25 - <ClCompile Include="stdafx.cpp"> 26 - <Filter>Source Files</Filter> 27 - </ClCompile> 28 - <ClCompile Include="VisualStyle.cpp"> 29 - <Filter>Source Files</Filter> 30 - </ClCompile> 31 - <ClCompile Include="Calculator.cpp"> 32 - <Filter>Source Files</Filter> 33 - </ClCompile> 34 - <ClCompile Include="CalculatorDeskBand.cpp"> 35 - <Filter>Source Files</Filter> 36 - </ClCompile> 37 - <ClCompile Include="Utils.cpp"> 38 - <Filter>Source Files</Filter> 39 - </ClCompile> 40 - <ClCompile Include="TaskbarCalculatorDeskBandDll.cpp"> 41 - <Filter>Source Files</Filter> 42 - </ClCompile> 43 - <ClCompile Include="CalculatorWindow.cpp"> 44 - <Filter>Source Files</Filter> 45 - </ClCompile> 18 + <ClCompile Include="App.cpp"><Filter>Source Files</Filter></ClCompile> 19 + <ClCompile Include="Calculator.cpp"><Filter>Source Files</Filter></ClCompile> 20 + <ClCompile Include="Utils.cpp"><Filter>Source Files</Filter></ClCompile> 21 + <ClCompile Include="VisualStyle.cpp"><Filter>Source Files</Filter></ClCompile> 22 + <ClCompile Include="stdafx.cpp"><Filter>Source Files</Filter></ClCompile> 46 23 </ItemGroup> 47 24 <ItemGroup> 48 - <None Include="TaskbarCalculator.def"> 49 - <Filter>Source Files</Filter> 50 - </None> 51 - <None Include="TaskbarCalculator.rgs"> 52 - <Filter>Resource Files</Filter> 53 - </None> 25 + <ClInclude Include="Calculator.h"><Filter>Header Files</Filter></ClInclude> 26 + <ClInclude Include="CalculatorWindow.h"><Filter>Header Files</Filter></ClInclude> 27 + <ClInclude Include="resource.h"><Filter>Header Files</Filter></ClInclude> 28 + <ClInclude Include="stdafx.h"><Filter>Header Files</Filter></ClInclude> 29 + <ClInclude Include="targetver.h"><Filter>Header Files</Filter></ClInclude> 30 + <ClInclude Include="Utils.h"><Filter>Header Files</Filter></ClInclude> 31 + <ClInclude Include="VisualStyle.h"><Filter>Header Files</Filter></ClInclude> 54 32 </ItemGroup> 55 33 <ItemGroup> 56 - <ClInclude Include="DllMain.h"> 57 - <Filter>Header Files</Filter> 58 - </ClInclude> 59 - <ClInclude Include="Resource.h"> 60 - <Filter>Header Files</Filter> 61 - </ClInclude> 62 - <ClInclude Include="stdafx.h"> 63 - <Filter>Header Files</Filter> 64 - </ClInclude> 65 - <ClInclude Include="targetver.h"> 66 - <Filter>Header Files</Filter> 67 - </ClInclude> 68 - <ClInclude Include="VisualStyle.h"> 69 - <Filter>Header Files</Filter> 70 - </ClInclude> 71 - <ClInclude Include="Calculator.h"> 72 - <Filter>Header Files</Filter> 73 - </ClInclude> 74 - <ClInclude Include="CalculatorDeskBand.h"> 75 - <Filter>Header Files</Filter> 76 - </ClInclude> 77 - <ClInclude Include="Guids.h"> 78 - <Filter>Header Files</Filter> 79 - </ClInclude> 80 - <ClInclude Include="CalculatorWindow.h"> 81 - <Filter>Header Files</Filter> 82 - </ClInclude> 83 - <ClInclude Include="Utils.h"> 84 - <Filter>Header Files</Filter> 85 - </ClInclude> 86 - <ClInclude Include="DateFormatSettingsRes.h"> 87 - <Filter>Header Files</Filter> 88 - </ClInclude> 89 - </ItemGroup> 90 - <ItemGroup> 91 - <ResourceCompile Include="TaskbarCalculator.rc"> 92 - <Filter>Resource Files</Filter> 93 - </ResourceCompile> 34 + <ResourceCompile Include="TaskbarCalculator.rc"><Filter>Resource Files</Filter></ResourceCompile> 94 35 </ItemGroup> 95 36 <ItemGroup> 96 - <Image Include="Resource\tbcalc.ico"> 97 - <Filter>Resource Files</Filter> 98 - </Image> 37 + <Image Include="Resource\tbcalc.ico"><Filter>Resource Files</Filter></Image> 99 38 </ItemGroup> 100 - </Project> 39 + </Project>
-66
TaskbarCalculatorDeskBandDll.cpp
··· 1 - // CalendarDeskBand.cpp : Implementation of DLL Exports. 2 - 3 - #include "stdafx.h" 4 - #include "Guids.h" 5 - #include "DllMain.h" 6 - 7 - // Used to determine whether the DLL can be unloaded by OLE 8 - STDAPI DllCanUnloadNow(void) 9 - { 10 - return _AtlModule.DllCanUnloadNow(); 11 - } 12 - 13 - 14 - // Returns a class factory to create an object of the requested type 15 - STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) 16 - { 17 - return _AtlModule.DllGetClassObject(rclsid, riid, ppv); 18 - } 19 - 20 - 21 - // DllRegisterServer - Adds entries to the system registry 22 - STDAPI DllRegisterServer(void) 23 - { 24 - // registers object, typelib and all interfaces in typelib 25 - return _AtlModule.DllRegisterServer(/*bRegTypeLib =*/ FALSE); 26 - } 27 - 28 - 29 - // DllUnregisterServer - Removes entries from the system registry 30 - STDAPI DllUnregisterServer(void) 31 - { 32 - return _AtlModule.DllUnregisterServer(/*bUnRegTypeLib =*/ FALSE); 33 - } 34 - 35 - // DllInstall - Adds/Removes entries to the system registry per user 36 - // per machine. 37 - STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) 38 - { 39 - HRESULT hr = E_FAIL; 40 - static const wchar_t szUserSwitch[] = _T("user"); 41 - 42 - if (pszCmdLine != NULL) 43 - { 44 - if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) 45 - { 46 - AtlSetPerUserRegistration(true); 47 - } 48 - } 49 - 50 - if (bInstall) 51 - { 52 - hr = DllRegisterServer(); 53 - if (FAILED(hr)) 54 - { 55 - DllUnregisterServer(); 56 - } 57 - } 58 - else 59 - { 60 - hr = DllUnregisterServer(); 61 - } 62 - 63 - return hr; 64 - } 65 - 66 -
-1
Utils.cpp
··· 1 1 #include "StdAfx.h" 2 2 #include "Utils.h" 3 - #include "Guids.h" 4 3 5 4 using namespace ATL; 6 5