├── README.md ├── The Code Project Open License (CPOL) 1.02.md ├── ThumbRefresh ├── AboutDlg.cpp ├── AboutDlg.h ├── MainDlg.cpp ├── MainDlg.h ├── ThumbRefresh.cpp ├── ThumbRefresh.h ├── ThumbRefresh.rc ├── ThumbRefresh.vcproj ├── dragdialog.h ├── droptarget.h ├── res │ ├── ThumbRefresh.ico │ └── dropicon.bmp ├── resource.h ├── stdafx.cpp ├── stdafx.h └── tools.h └── thumbrefresh.png /README.md: -------------------------------------------------------------------------------- 1 | # Thumbnail Refresh Tool 2 | Refresh file thumbnails in Vista and Windows 7 3 |

![alt text](https://github.com/T800G/ThumbnailRefreshTool/blob/master/thumbrefresh.png)
4 | ## Minimum system requirements 5 | Windows Vista / Windows 7 (32 / 64-bit) 6 | -------------------------------------------------------------------------------- /The Code Project Open License (CPOL) 1.02.md: -------------------------------------------------------------------------------- 1 |

The Code Project Open License (CPOL) 1.02

2 |
3 | 4 |
5 |
6 | 7 |

Preamble

8 |

9 | This License governs Your use of the Work. This License is intended to allow developers 10 | to use the Source Code and Executable Files provided as part of the Work in any 11 | application in any form. 12 |

13 |

14 | The main points subject to the terms of the License are:

15 | 24 | 25 |

26 | This License is entered between You, the individual or other entity reading or otherwise 27 | making use of the Work licensed pursuant to this License and the individual or other 28 | entity which offers the Work under the terms of this License ("Author").

29 | 30 |

License

31 |

32 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CODE PROJECT OPEN 33 | LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE 34 | LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT 35 | LAW IS PROHIBITED.

36 |

37 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE TO BE 38 | BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS CONTAINED HEREIN 39 | IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. IF YOU DO NOT 40 | AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS LICENSE, YOU CANNOT MAKE ANY 41 | USE OF THE WORK.

42 | 43 |
    44 |
  1. Definitions. 45 | 46 |
      47 |
    1. "Articles" means, collectively, all articles written by Author 48 | which describes how the Source Code and Executable Files for the Work may be used 49 | by a user.
    2. 50 |
    3. "Author" means the individual or entity that offers the Work under the terms 51 | of this License.
    4. 52 |
    5. "Derivative Work" means a work based upon the Work or upon the 53 | Work and other pre-existing works.
    6. 54 |
    7. "Executable Files" refer to the executables, binary files, configuration 55 | and any required data files included in the Work.
    8. 56 |
    9. "Publisher" means the provider of the website, magazine, CD-ROM, DVD or other 57 | medium from or by which the Work is obtained by You.
    10. 58 |
    11. "Source Code" refers to the collection of source code and configuration files 59 | used to create the Executable Files.
    12. 60 |
    13. "Standard Version" refers to such a Work if it has not been modified, or 61 | has been modified in accordance with the consent of the Author, such consent being 62 | in the full discretion of the Author.
    14. 63 |
    15. "Work" refers to the collection of files distributed by the Publisher, including 64 | the Source Code, Executable Files, binaries, data files, documentation, whitepapers 65 | and the Articles.
    16. 66 |
    17. "You" is you, an individual or entity wishing to use the Work and exercise 67 | your rights under this License. 68 |
    18. 69 |
    70 |
  2. 71 | 72 |
  3. Fair Use/Fair Use Rights. Nothing in this License is intended to 73 | reduce, limit, or restrict any rights arising from fair use, fair dealing, first 74 | sale or other limitations on the exclusive rights of the copyright owner under copyright 75 | law or other applicable laws. 76 |
  4. 77 | 78 |
  5. License Grant. Subject to the terms and conditions of this License, 79 | the Author hereby grants You a worldwide, royalty-free, non-exclusive, perpetual 80 | (for the duration of the applicable copyright) license to exercise the rights in 81 | the Work as stated below: 82 | 83 |
      84 |
    1. You may use the standard version of the Source Code or Executable Files in Your 85 | own applications.
    2. 86 |
    3. You may apply bug fixes, portability fixes and other modifications obtained from 87 | the Public Domain or from the Author. A Work modified in such a way shall still 88 | be considered the standard version and will be subject to this License.
    4. 89 |
    5. You may otherwise modify Your copy of this Work (excluding the Articles) in any 90 | way to create a Derivative Work, provided that You insert a prominent notice in 91 | each changed file stating how, when and where You changed that file.
    6. 92 |
    7. You may distribute the standard version of the Executable Files and Source Code 93 | or Derivative Work in aggregate with other (possibly commercial) programs as part 94 | of a larger (possibly commercial) software distribution.
    8. 95 |
    9. The Articles discussing the Work published in any form by the author may not be 96 | distributed or republished without the Author's consent. The author retains 97 | copyright to any such Articles. You may use the Executable Files and Source Code 98 | pursuant to this License but you may not repost or republish or otherwise distribute 99 | or make available the Articles, without the prior written consent of the Author.
    10. 100 |
    101 | 102 | Any subroutines or modules supplied by You and linked into the Source Code or Executable 103 | Files of this Work shall not be considered part of this Work and will not be subject 104 | to the terms of this License. 105 |
  6. 106 | 107 |
  7. Patent License. Subject to the terms and conditions of this License, 108 | each Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, 109 | irrevocable (except as stated in this section) patent license to make, have made, use, import, 110 | and otherwise transfer the Work.
  8. 111 | 112 |
  9. Restrictions. The license granted in Section 3 above is expressly 113 | made subject to and limited by the following restrictions: 114 | 115 |
      116 |
    1. You agree not to remove any of the original copyright, patent, trademark, and 117 | attribution notices and associated disclaimers that may appear in the Source Code 118 | or Executable Files.
    2. 119 |
    3. You agree not to advertise or in any way imply that this Work is a product of Your 120 | own.
    4. 121 |
    5. The name of the Author may not be used to endorse or promote products derived from 122 | the Work without the prior written consent of the Author.
    6. 123 |
    7. You agree not to sell, lease, or rent any part of the Work. This does not restrict 124 | you from including the Work or any part of the Work inside a larger software 125 | distribution that itself is being sold. The Work by itself, though, cannot be sold, 126 | leased or rented.
    8. 127 |
    9. You may distribute the Executable Files and Source Code only under the terms of 128 | this License, and You must include a copy of, or the Uniform Resource Identifier 129 | for, this License with every copy of the Executable Files or Source Code You distribute 130 | and ensure that anyone receiving such Executable Files and Source Code agrees that 131 | the terms of this License apply to such Executable Files and/or Source Code. You 132 | may not offer or impose any terms on the Work that alter or restrict the terms of 133 | this License or the recipients' exercise of the rights granted hereunder. You 134 | may not sublicense the Work. You must keep intact all notices that refer to this 135 | License and to the disclaimer of warranties. You may not distribute the Executable 136 | Files or Source Code with any technological measures that control access or use 137 | of the Work in a manner inconsistent with the terms of this License.
    10. 138 |
    11. You agree not to use the Work for illegal, immoral or improper purposes, or on pages 139 | containing illegal, immoral or improper material. The Work is subject to applicable 140 | export laws. You agree to comply with all such laws and regulations that may apply 141 | to the Work after Your receipt of the Work. 142 |
    12. 143 |
    144 |
  10. 145 | 146 |
  11. Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED 147 | "AS IS", "WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES 148 | OR CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, INCLUDING 149 | COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. AUTHOR EXPRESSLY 150 | DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES OR CONDITIONS, INCLUDING 151 | WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY 152 | OR FITNESS FOR A PARTICULAR PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, 153 | OR THAT THE WORK (OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF 154 | VIRUSES. YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE 155 | WORKS. 156 |
  12. 157 | 158 |
  13. Indemnity. You agree to defend, indemnify and hold harmless the Author and 159 | the Publisher from and against any claims, suits, losses, damages, liabilities, 160 | costs, and expenses (including reasonable legal or attorneys fees) resulting from 161 | or relating to any use of the Work by You. 162 |
  14. 163 | 164 |
  15. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE 165 | LAW, IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL 166 | THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES 167 | ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, EVEN IF THE AUTHOR 168 | OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 169 |
  16. 170 | 171 |
  17. Termination. 172 | 173 |
      174 |
    1. This License and the rights granted hereunder will terminate automatically upon 175 | any breach by You of any term of this License. Individuals or entities who have 176 | received Derivative Works from You under this License, however, will not have their 177 | licenses terminated provided such individuals or entities remain in full compliance 178 | with those licenses. Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination 179 | of this License.
    2. 180 | 181 |
    3. If You bring a copyright, trademark, patent or any other infringement claim against 182 | any contributor over infringements You claim are made by the Work, your License 183 | from such contributor to the Work ends automatically.
    4. 184 | 185 |
    5. Subject to the above terms and conditions, this License is perpetual (for the duration 186 | of the applicable copyright in the Work). Notwithstanding the above, the Author 187 | reserves the right to release the Work under different license terms or to stop 188 | distributing the Work at any time; provided, however that any such election will 189 | not serve to withdraw this License (or any other license that has been, or is required 190 | to be, granted under the terms of this License), and this License will continue 191 | in full force and effect unless terminated as stated above. 192 |
    6. 193 |
    194 |
  18. 195 | 196 |
  19. Publisher. The parties hereby confirm that the Publisher shall 197 | not, under any circumstances, be responsible for and shall not have any liability 198 | in respect of the subject matter of this License. The Publisher makes no warranty 199 | whatsoever in connection with the Work and shall not be liable to You or any party 200 | on any legal theory for any damages whatsoever, including without limitation any 201 | general, special, incidental or consequential damages arising in connection to this 202 | license. The Publisher reserves the right to cease making the Work available to 203 | You at any time without notice
  20. 204 | 205 |
  21. Miscellaneous 206 | 207 |
      208 |
    1. This License shall be governed by the laws of the location of the head office of 209 | the Author or if the Author is an individual, the laws of location of the principal 210 | place of residence of the Author.
    2. 211 |
    3. If any provision of this License is invalid or unenforceable under applicable law, 212 | it shall not affect the validity or enforceability of the remainder of the terms 213 | of this License, and without further action by the parties to this License, such 214 | provision shall be reformed to the minimum extent necessary to make such provision 215 | valid and enforceable.
    4. 216 |
    5. No term or provision of this License shall be deemed waived and no breach consented 217 | to unless such waiver or consent shall be in writing and signed by the party to 218 | be charged with such waiver or consent.
    6. 219 |
    7. This License constitutes the entire agreement between the parties with respect to 220 | the Work licensed herein. There are no understandings, agreements or representations 221 | with respect to the Work not specified herein. The Author shall not be bound by 222 | any additional provisions that may appear in any communication from You. This License 223 | may not be modified without the mutual written agreement of the Author and You. 224 |
    8. 225 |
    226 | 227 |
  22. 228 |
229 | 230 |
231 |
232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /ThumbRefresh/AboutDlg.cpp: -------------------------------------------------------------------------------- 1 | // aboutdlg.cpp : implementation of the CAboutDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "resource.h" 7 | 8 | #include "aboutdlg.h" 9 | 10 | LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 11 | { 12 | CenterWindow(GetParent()); 13 | return TRUE; 14 | } 15 | 16 | LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 17 | { 18 | EndDialog(wID); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /ThumbRefresh/AboutDlg.h: -------------------------------------------------------------------------------- 1 | // aboutdlg.h : interface of the CAboutDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | 7 | #include "dragdialog.h" 8 | 9 | class CAboutDlg : public CDialogImpl, public CDragDialog 10 | { 11 | public: 12 | enum { IDD = IDD_ABOUTBOX }; 13 | 14 | BEGIN_MSG_MAP(CAboutDlg) 15 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 16 | COMMAND_ID_HANDLER(IDOK, OnCloseCmd) 17 | COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) 18 | CHAIN_MSG_MAP(CDragDialog) 19 | END_MSG_MAP() 20 | 21 | // Handler prototypes (uncomment arguments if needed): 22 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 23 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 24 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 25 | 26 | LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 27 | LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 28 | }; 29 | -------------------------------------------------------------------------------- /ThumbRefresh/MainDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/T800G/ThumbnailRefreshTool/2293825797c660fb9b33ad64dbb99b55b69f81c4/ThumbRefresh/MainDlg.cpp -------------------------------------------------------------------------------- /ThumbRefresh/MainDlg.h: -------------------------------------------------------------------------------- 1 | // MainDlg.h : interface of the CMainDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | 7 | #include "droptarget.h" 8 | #include "dragdialog.h" 9 | #include "tools.h" 10 | 11 | #include 12 | #include //IThumbnailCache 13 | 14 | class CMainDlg : public CDialogImpl, public CUpdateUI, 15 | public CMessageFilter, public CIdleHandler, public CDropFileTarget, public CDragDialog 16 | { 17 | public: 18 | enum { IDD = IDD_MAINDLG }; 19 | 20 | virtual BOOL PreTranslateMessage(MSG* pMsg); 21 | virtual BOOL OnIdle(); 22 | 23 | BEGIN_UPDATE_UI_MAP(CMainDlg) 24 | END_UPDATE_UI_MAP() 25 | 26 | BEGIN_MSG_MAP(CMainDlg) 27 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 28 | MESSAGE_HANDLER(WM_DESTROY, OnDestroy) 29 | MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnStaticCtlColor) 30 | MESSAGE_HANDLER(WM_SYSCOMMAND, OnSysCommand) 31 | 32 | COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) 33 | 34 | COMMAND_ID_HANDLER(IDC_ACTION, OnAction) 35 | COMMAND_ID_HANDLER(IDOK, OnAction)//OnOK) 36 | COMMAND_ID_HANDLER(IDCANCEL, OnAction)//OnCancel) 37 | 38 | CHAIN_MSG_MAP(CDropFileTarget) 39 | CHAIN_MSG_MAP(CDragDialog) 40 | END_MSG_MAP() 41 | 42 | // Handler prototypes (uncomment arguments if needed): 43 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 44 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 45 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 46 | 47 | LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 48 | LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 49 | LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 50 | //LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 51 | //LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 52 | 53 | void CloseDialog(int nVal); 54 | 55 | //private: 56 | LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); 57 | LRESULT OnAction(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 58 | LRESULT OnStaticCtlColor(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); 59 | BOOL StartDropFile(UINT uNumFiles); 60 | BOOL ProcessDropFile(LPCTSTR szDropFile, UINT nFile); 61 | void FinishDropFile(); 62 | void ProcessDlgMessages(); 63 | HRESULT RefreshThumbnail(LPCTSTR szFile); 64 | 65 | HWND m_hActionBtn; 66 | HWND m_hProgress; 67 | HWND m_hFileLabel; 68 | IThumbnailCache* pThumbnailCache; 69 | CFont m_fBold; 70 | BOOL m_bAbort; 71 | UINT64 m_uProcessed; 72 | MSG m_msg; 73 | }; 74 | -------------------------------------------------------------------------------- /ThumbRefresh/ThumbRefresh.cpp: -------------------------------------------------------------------------------- 1 | // ThumbRefresh.cpp : main source file for ThumbRefresh.exe 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | #include "resource.h" 7 | 8 | #include "aboutdlg.h" 9 | #include "MainDlg.h" 10 | 11 | CAppModule _Module; 12 | 13 | int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT) 14 | { 15 | CMessageLoop theLoop; 16 | _Module.AddMessageLoop(&theLoop); 17 | 18 | CMainDlg dlgMain; 19 | 20 | if(dlgMain.Create(NULL) == NULL) 21 | { 22 | ATLTRACE(_T("Main dialog creation failed!\n")); 23 | return 0; 24 | } 25 | 26 | dlgMain.ShowWindow(nCmdShow); 27 | 28 | int nRet = theLoop.Run(); 29 | 30 | _Module.RemoveMessageLoop(); 31 | 32 | return nRet; 33 | } 34 | 35 | int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow) 36 | { 37 | HRESULT hRes = ::CoInitialize(NULL); 38 | // If you are running on NT 4.0 or higher you can use the following call instead to 39 | // make the EXE free threaded. This means that calls come in on a random RPC thread. 40 | // HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED); 41 | ATLASSERT(SUCCEEDED(hRes)); 42 | 43 | // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used 44 | ::DefWindowProc(NULL, 0, 0, 0L); 45 | 46 | AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls 47 | 48 | hRes = _Module.Init(NULL, hInstance); 49 | ATLASSERT(SUCCEEDED(hRes)); 50 | 51 | int nRet = Run(lpstrCmdLine, nCmdShow); 52 | 53 | _Module.Term(); 54 | ::CoUninitialize(); 55 | 56 | return nRet; 57 | } 58 | -------------------------------------------------------------------------------- /ThumbRefresh/ThumbRefresh.h: -------------------------------------------------------------------------------- 1 | // ThumbRefresh.h 2 | -------------------------------------------------------------------------------- /ThumbRefresh/ThumbRefresh.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/T800G/ThumbnailRefreshTool/2293825797c660fb9b33ad64dbb99b55b69f81c4/ThumbRefresh/ThumbRefresh.rc -------------------------------------------------------------------------------- /ThumbRefresh/ThumbRefresh.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 25 | 28 | 31 | 34 | 37 | 49 | 60 | 63 | 69 | 72 | 79 | 82 | 85 | 88 | 91 | 94 | 97 | 100 | 101 | 110 | 113 | 116 | 119 | 122 | 134 | 147 | 150 | 156 | 159 | 167 | 170 | 173 | 176 | 179 | 182 | 185 | 188 | 189 | 190 | 191 | 192 | 193 | 197 | 200 | 203 | 207 | 208 | 211 | 215 | 216 | 217 | 220 | 221 | 224 | 225 | 226 | 230 | 233 | 234 | 237 | 238 | 241 | 242 | 243 | 247 | 250 | 251 | 254 | 255 | 258 | 259 | 262 | 263 | 264 | 267 | 270 | 271 | 274 | 275 | 278 | 279 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | -------------------------------------------------------------------------------- /ThumbRefresh/dragdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef _DRAGDIALOG_00963332_3E7F_485E_B158_7D74EAB60EDE_ 2 | #define _DRAGDIALOG_00963332_3E7F_485E_B158_7D74EAB60EDE_ 3 | 4 | //dialog drag support 5 | template class CDragDialog 6 | { 7 | public: 8 | BEGIN_MSG_MAP(CDragDialog) 9 | MESSAGE_HANDLER(WM_NCHITTEST, OnNCHitTest) 10 | END_MSG_MAP() 11 | 12 | protected: 13 | virtual LRESULT OnNCHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) 14 | { 15 | T* pT=static_cast(this); 16 | m_lHitTest = ::DefWindowProcW(pT->m_hWnd, uMsg, wParam, lParam); 17 | if (m_lHitTest == HTCLIENT) return HTCAPTION; 18 | return m_lHitTest; 19 | } 20 | 21 | private: 22 | LRESULT m_lHitTest; 23 | }; 24 | 25 | 26 | #endif//_DRAGDIALOG_00963332_3E7F_485E_B158_7D74EAB60EDE_ 27 | -------------------------------------------------------------------------------- /ThumbRefresh/droptarget.h: -------------------------------------------------------------------------------- 1 | #ifndef _DROPTARGET_22D5EC3E_31DE_4620_AA1E_3948683120E3_ 2 | #define _DROPTARGET_22D5EC3E_31DE_4620_AA1E_3948683120E3_ 3 | 4 | #include 5 | #pragma comment(lib, "shell32.lib") 6 | 7 | template class CDropFileTarget // implements dropfile target window 8 | { 9 | public: 10 | BEGIN_MSG_MAP(CDropFileTarget) 11 | MESSAGE_HANDLER(WM_DROPFILES, OnDropFiles) 12 | END_MSG_MAP() 13 | 14 | void RegisterDropTarget(BOOL bAccept = TRUE) 15 | { 16 | T* pT=static_cast(this); 17 | ATLASSERT(::IsWindow(pT->m_hWnd)); 18 | ::DragAcceptFiles(pT->m_hWnd, bAccept); 19 | } 20 | 21 | protected: 22 | virtual BOOL StartDropFile(UINT uNumFiles){ATLTRACE("CDropFileTarget::StartDropFile\n");return TRUE;} 23 | virtual BOOL ProcessDropFile(LPCTSTR szDropFile, UINT nFile){ATLTRACE(_T("CDropFileTarget::ProcessDropFile: %s"),szDropFile);return TRUE;} 24 | virtual void FinishDropFile(){ATLTRACE("CDropFileTarget::FinishDropFile\n");} 25 | 26 | virtual LRESULT OnDropFiles(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) 27 | { 28 | UINT i; 29 | UINT uMaxLen=0; 30 | UINT uNumFiles = ::DragQueryFile((HDROP)wParam, 0xFFFFFFFF, NULL, 0); 31 | if (!StartDropFile(uNumFiles)) return 0; 32 | 33 | for (i=0; i 9 | #endif //(_ATL_VER < 0x0700) 10 | -------------------------------------------------------------------------------- /ThumbRefresh/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | // Change these values to use different versions 9 | //#define WINVER 0x0500 10 | #define _WIN32_WINNT _WIN32_WINNT_VISTA 11 | #define _WIN32_IE _WIN32_IE_IE70 12 | //#define _RICHEDIT_VER 0x0200 13 | 14 | // This project was generated for VC++ 2005 Express and ATL 3.0 from Platform SDK. 15 | // Comment out this line to build the project with different versions of VC++ and ATL. 16 | #define _WTL_SUPPORT_SDK_ATL3 17 | 18 | // Support for VS2005 Express & SDK ATL 19 | #ifdef _WTL_SUPPORT_SDK_ATL3 20 | #if (_ATL_VER<0x0800) 21 | #define _CRT_SECURE_NO_DEPRECATE 22 | #pragma conform(forScope, off) 23 | #endif 24 | #pragma comment(linker, "/NODEFAULTLIB:atlthunk.lib") 25 | #endif // _WTL_SUPPORT_SDK_ATL3 26 | 27 | #include 28 | 29 | // Support for VS2005 Express & SDK ATL 30 | #ifdef _WTL_SUPPORT_SDK_ATL3 31 | #if (_ATL_VER>=0x0800) 32 | #ifndef __ATLSTDTHUNK_H__ 33 | #include // _stdcallthunk definition 34 | #endif 35 | #endif 36 | namespace ATL 37 | { 38 | inline void * __stdcall __AllocStdCallThunk() 39 | { 40 | return ::VirtualAlloc(0, sizeof(_stdcallthunk), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); 41 | } 42 | 43 | inline void __stdcall __FreeStdCallThunk(void *p) 44 | { 45 | if (p) ::VirtualFree(p, 0, MEM_RELEASE); 46 | } 47 | }; 48 | #endif // _WTL_SUPPORT_SDK_ATL3 49 | 50 | #include 51 | 52 | extern CAppModule _Module; 53 | 54 | #include 55 | 56 | #include 57 | #include 58 | #include 59 | #include 60 | 61 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 62 | -------------------------------------------------------------------------------- /ThumbRefresh/tools.h: -------------------------------------------------------------------------------- 1 | #ifndef _TOOLS_BBFA8B6D_CAF9_4FE3_95C3_7F3B43F140F0_ 2 | #define _TOOLS_BBFA8B6D_CAF9_4FE3_95C3_7F3B43F140F0_ 3 | 4 | inline BOOL IsClearTypeEnabled() 5 | { 6 | BOOL check=0; 7 | if (!SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &check,0)) return FALSE; 8 | if (!check) return FALSE; 9 | UINT check2=0; 10 | if (!SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &check2,0)) return FALSE; 11 | return (check2==FE_FONTSMOOTHINGCLEARTYPE); 12 | } 13 | 14 | 15 | 16 | 17 | // safe string functions 18 | #include 19 | #pragma comment(lib,"strsafe.lib") 20 | // IPersistFile is using LPCOLESTR,so make sure that the string is Unicode 21 | #ifndef _UNICODE 22 | #error IPersistFile requires UNICODE 23 | #endif 24 | #include 25 | #include 26 | inline HRESULT ResolveShellShortcut(/*in*/ LPCTSTR lpszShortcutPath, /*out*/ LPTSTR lpszFilePath, /*in*/size_t cchFilePath) 27 | { 28 | CComPtr ipShellLink; 29 | // Get a pointer to the IShellLink interface 30 | HRESULT hRes=CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**)&ipShellLink); 31 | if (hRes!=S_OK) return hRes; 32 | 33 | // Get a pointer to the IPersistFile interface on the shortcut 34 | CComQIPtr ipPersistFile(ipShellLink); 35 | 36 | // Open the shortcut file and initialize it from its contents 37 | hRes=ipPersistFile->Load(lpszShortcutPath, STGM_READ); 38 | if (hRes!=S_OK) return hRes; 39 | 40 | // Get the path to the shortcut target 41 | // Returns S_OK if the operation is successful and a valid path is retrieved. 42 | // If the operation is successful, but no path is retrieved, 43 | // it returns S_FALSE and pszFile will be empty. //(!((hRes==S_OK) || (hRes==S_FALSE))) 44 | // SLGP_UNCPRIORITY - Retrieves the Universal Naming Convention (UNC) path name of the file.>>>>>>>>za UNC 45 | 46 | hRes = ipShellLink->GetPath(lpszFilePath, cchFilePath, NULL, SLGP_RAWPATH | SLGP_UNCPRIORITY); 47 | 48 | return hRes; 49 | } 50 | 51 | #endif//_TOOLS_BBFA8B6D_CAF9_4FE3_95C3_7F3B43F140F0_ 52 | -------------------------------------------------------------------------------- /thumbrefresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/T800G/ThumbnailRefreshTool/2293825797c660fb9b33ad64dbb99b55b69f81c4/thumbrefresh.png --------------------------------------------------------------------------------