1
0

copyprep.cpp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. #include "main.h"
  2. #include "./copyfiles.h"
  3. #include "./copyinternal.h"
  4. #include "./resource.h"
  5. #include "./settings.h"
  6. #include "../nu/trace.h"
  7. #include <shlwapi.h>
  8. #include <strsafe.h>
  9. typedef struct _PREPDLG
  10. {
  11. HFONT hfItalic;
  12. HWND hActiveHelp;
  13. HBITMAP hbmpLogo;
  14. IAutoComplete *pac;
  15. IACList2 *pacl2;
  16. COPYDATA *pCopyData;
  17. TCHAR szCurrentRoot[MAX_PATH];
  18. } PREPDLG;
  19. typedef struct _CALCDISKSIZE
  20. {
  21. HWND hCallback;
  22. DWORD dwError;
  23. ULARGE_INTEGER bytesFree;
  24. ULARGE_INTEGER bytesTotal;
  25. TCHAR szRoot[MAX_PATH];
  26. } CALCDISKSIZE;
  27. #define PREPDLG_PROP TEXT("PREPDLG")
  28. #define GetPrepDlg(__hdlg) ((PREPDLG*)GetProp((__hdlg), PREPDLG_PROP))
  29. #define TID_UPDATEDISKSIZE 1985
  30. #define DELAY_UPDATEDISKSIZE 100
  31. static void DisplayFormatExample(HWND hdlg, INT nItemId)
  32. {
  33. TCHAR szBuffer[MAX_PATH*2], szFormat[MAX_PATH] = {0};
  34. Settings_ReadString(C_COPY, CF_TITLEFMT, szFormat, ARRAYSIZE(szFormat));
  35. szBuffer[0] = TEXT('\0');
  36. FormatFileName(szBuffer, ARRAYSIZE(szBuffer), szFormat, 10,
  37. TEXT("U2"),
  38. TEXT("The Joshua Tree"),
  39. TEXT("Exit"),
  40. TEXT("Rock"),
  41. TEXT("1987"),
  42. TEXT("U2"),
  43. TEXT("u2_The_Joshua_Tree.Mp3"),
  44. TEXT(""));
  45. SetDlgItemText(hdlg, nItemId, szBuffer);
  46. }
  47. static DWORD WINAPI DiskFreeSpace_ThreadProc(LPVOID param)
  48. {
  49. CALCDISKSIZE *pcs = (CALCDISKSIZE*)param;
  50. if (!pcs) return 0;
  51. pcs->dwError = 0;
  52. SetLastError(0);
  53. if (!GetDiskFreeSpaceEx(pcs->szRoot, &pcs->bytesFree, &pcs->bytesTotal, NULL))
  54. pcs->dwError = GetLastError();
  55. PostMessage(pcs->hCallback, CPM_UPDATEDISKSIZE, 0, (LPARAM)pcs);
  56. return 0;
  57. }
  58. static void CopyPrepare_UpdateMessage(HWND hdlg)
  59. {
  60. TCHAR szBuffer[MAX_PATH*2] = {0};
  61. PREPDLG *ppd = GetPrepDlg(hdlg);
  62. szBuffer[0] = TEXT('\0');
  63. if (ppd && ppd->pCopyData)
  64. {
  65. TCHAR szPath[MAX_PATH] = {0}, szFormat[256] = {0};
  66. if (S_OK != Settings_ReadString(C_COPY, CF_PATH, szPath, ARRAYSIZE(szPath))) *szPath = TEXT('\0');
  67. else CleanupDirectoryString(szPath);
  68. if (1 == ppd->pCopyData->count)
  69. {
  70. WASABI_API_LNGSTRINGW_BUF(IDS_COPY_PREP_MESSAGE_SINGLE_FILE, szFormat, ARRAYSIZE(szFormat));
  71. StringCchPrintf(szBuffer, ARRAYSIZE(szBuffer), szFormat, PathFindFileName(ppd->pCopyData->ppszFiles[0]), szPath);
  72. }
  73. else
  74. {
  75. WASABI_API_LNGSTRINGW_BUF(IDS_COPY_PREP_MESSAGE_MULTIPLE_FILES, szFormat, ARRAYSIZE(szFormat));
  76. StringCchPrintf(szBuffer, ARRAYSIZE(szBuffer), szFormat, ppd->pCopyData->count, szPath);
  77. }
  78. }
  79. SetDlgItemText(hdlg, IDC_LBL_MESSAGE, szBuffer);
  80. }
  81. HBITMAP CopyFiles_LoadResourcePng(LPCTSTR pszResource)
  82. {
  83. HBITMAP hbmp;
  84. MLIMAGESOURCE src = { sizeof(MLIMAGESOURCE), };
  85. src.lpszName = pszResource;
  86. src.type = SRC_TYPE_PNG;
  87. src.flags = 0;
  88. src.hInst = WASABI_API_LNG_HINST;
  89. hbmp = MLImageLoader_LoadDib(plugin.hwndLibraryParent, &src);
  90. if(!hbmp)
  91. {
  92. src.hInst = WASABI_API_ORIG_HINST;
  93. hbmp = MLImageLoader_LoadDib(plugin.hwndLibraryParent, &src);
  94. }
  95. DIBSECTION dibsec;
  96. if (hbmp && sizeof(DIBSECTION) == GetObjectW(hbmp, sizeof(DIBSECTION), &dibsec) &&
  97. BI_RGB == dibsec.dsBmih.biCompression && 1 == dibsec.dsBmih.biPlanes && 32 == dibsec.dsBm.bmBitsPixel)
  98. {
  99. MLIMAGEFILTERAPPLYEX filter = { sizeof(MLIMAGEFILTERAPPLYEX), };
  100. filter.filterUID = MLIF_BLENDONBK_UID;
  101. filter.cx = dibsec.dsBm.bmWidth;
  102. filter.cy = dibsec.dsBm.bmHeight;
  103. filter.bpp = dibsec.dsBm.bmBitsPixel;
  104. filter.pData = (LPBYTE)dibsec.dsBm.bmBits;
  105. filter.rgbBk = GetSysColor(COLOR_3DFACE);
  106. MLImageFilter_ApplyEx(plugin.hwndLibraryParent, &filter);
  107. }
  108. return hbmp;
  109. }
  110. static INT_PTR CopyPrepare_OnInitDialog(HWND hdlg, HWND hFocus, LPARAM lParam)
  111. {
  112. HWND hctrl;
  113. PREPDLG *ppd = (PREPDLG*)calloc(1, sizeof(PREPDLG));
  114. if (!ppd) return 0;
  115. SetProp(hdlg, PREPDLG_PROP, ppd);
  116. ppd->pCopyData = (COPYDATA*)lParam;
  117. hctrl = GetDlgItem(hdlg, IDOK);
  118. if (hctrl) SendMessageW(hdlg, WM_NEXTDLGCTL, (WPARAM)hctrl, (LPARAM)TRUE);
  119. SendMessageW(hdlg, WM_COMMAND, MAKEWPARAM(IDC_BTN_OPTIONS, BN_CLICKED), (LPARAM)GetDlgItem(hdlg, IDC_BTN_OPTIONS));
  120. hctrl = GetDlgItem(hdlg, IDC_LBL_EXAMPLE);
  121. if (hctrl)
  122. {
  123. LOGFONT lf;
  124. HFONT hf = (HFONT)SendMessage(hctrl, WM_GETFONT, 0, 0L);
  125. if (NULL == hf) hf = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
  126. if (GetObject(hf, sizeof(LOGFONT), &lf))
  127. {
  128. lf.lfItalic = TRUE;
  129. ppd->hfItalic = CreateFontIndirect(&lf);
  130. if (ppd->hfItalic)
  131. {
  132. UINT szIdList[] = { IDC_LBL_EXAMPLE_TITLE, IDC_LBL_EXAMPLE, IDC_LBL_FREE_TITLE, IDC_LBL_FREE, IDC_LBL_REQUIRED_TITLE, IDC_LBL_REQUIRED, };
  133. for (int i = 0; i < sizeof(szIdList)/sizeof(szIdList[0]); i++) SendDlgItemMessage(hdlg, szIdList[i], WM_SETFONT, (WPARAM)ppd->hfItalic, FALSE);
  134. }
  135. }
  136. }
  137. if (ppd->pCopyData && ppd->pCopyData->pFSizes)
  138. {
  139. TCHAR szBuffer[128] = {0};
  140. ULONGLONG total = 0;
  141. for(int i = 0; i < ppd->pCopyData->count; i++) total += ppd->pCopyData->pFSizes[i];
  142. StrFormatByteSize64(total, szBuffer, ARRAYSIZE(szBuffer));
  143. SetDlgItemText(hdlg, IDC_LBL_REQUIRED, szBuffer);
  144. }
  145. else
  146. {
  147. ShowWindow(GetDlgItem(hdlg, IDC_LBL_REQUIRED_TITLE), SW_HIDE);
  148. ShowWindow(GetDlgItem(hdlg, IDC_LBL_REQUIRED), SW_HIDE);
  149. }
  150. if (ppd->pCopyData && ppd->pCopyData->hOwner)
  151. {
  152. RECT rw;
  153. if (!GetWindowRect(ppd->pCopyData->hOwner, &rw)) SetRect(&rw, 0, 0, 0, 0);
  154. if (hdlg && rw.left != rw.right)
  155. {
  156. RECT rw2;
  157. GetWindowRect(hdlg, &rw2);
  158. SetWindowPos(hdlg, HWND_TOP,
  159. rw.left + ((rw.right - rw.left) - (rw2.right - rw2.left))/2,
  160. rw.top + ((rw.bottom - rw.top) - (rw2.bottom - rw2.top))/2,
  161. 0, 0, SWP_NOACTIVATE | SWP_NOSIZE);
  162. }
  163. }
  164. CopyPrepare_UpdateMessage(hdlg);
  165. SendMessage(hdlg, DM_REPOSITION, 0, 0L);
  166. ppd->hbmpLogo = CopyFiles_LoadResourcePng(MAKEINTRESOURCE(IDB_FILECOPY));
  167. if (ppd->hbmpLogo) SendDlgItemMessage(hdlg, IDC_PIC_LOGO, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)ppd->hbmpLogo);
  168. else ShowWindow(GetDlgItem(hdlg, IDC_PIC_LOGO), SW_HIDE);
  169. return FALSE;
  170. }
  171. static void CopyPrepare_OnDestroy(HWND hdlg)
  172. {
  173. PREPDLG *ppd = GetPrepDlg(hdlg);
  174. RemoveProp(hdlg, PREPDLG_PROP);
  175. if (ppd)
  176. {
  177. if (ppd->hActiveHelp) DestroyWindow(ppd->hActiveHelp);
  178. if (ppd->hfItalic) DeleteObject(ppd->hfItalic);
  179. if (ppd->pacl2) ppd->pacl2->Release();
  180. if (ppd->pac) ppd->pac->Release();
  181. if (ppd->hbmpLogo)
  182. {
  183. HBITMAP hbmp = (HBITMAP)SendDlgItemMessage(hdlg, IDC_PIC_LOGO, STM_GETIMAGE, IMAGE_BITMAP, 0L);
  184. if (hbmp != ppd->hbmpLogo) DeleteObject(hbmp);
  185. DeleteObject(ppd->hbmpLogo);
  186. }
  187. free(ppd);
  188. }
  189. }
  190. static void CopyPrepare_OnParentNotify(HWND hdlg, UINT uMsg, LPARAM lParam)
  191. {
  192. PREPDLG *ppd = GetPrepDlg(hdlg);
  193. if (ppd && WM_DESTROY == uMsg && ppd->hActiveHelp && ppd->hActiveHelp == (HWND)lParam)
  194. ppd->hActiveHelp = NULL;
  195. }
  196. static void CALLBACK CopyPrepare_OnUpdateDiskSizeTimer(HWND hdlg, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
  197. {
  198. KillTimer(hdlg, idEvent);
  199. CopyPrepare_UpdateMessage(hdlg);
  200. PREPDLG *ppd = GetPrepDlg(hdlg);
  201. if (!ppd) return;
  202. CALCDISKSIZE *pcs = (CALCDISKSIZE*)calloc(1, sizeof(CALCDISKSIZE));
  203. if (!pcs) return;
  204. pcs->hCallback = hdlg;
  205. if (S_OK == Settings_ReadString(C_COPY, CF_PATH, pcs->szRoot, ARRAYSIZE(pcs->szRoot)))
  206. {
  207. PathStripToRoot(pcs->szRoot);
  208. if (TEXT('\0') != *pcs->szRoot &&
  209. (TEXT('\0') == *ppd->szCurrentRoot ||
  210. CSTR_EQUAL != CompareString(STRCOMP_INVARIANT, NORM_IGNORECASE, ppd->szCurrentRoot, -1, pcs->szRoot, -1)))
  211. {
  212. DWORD threadId;
  213. SetDlgItemText(hdlg, IDC_LBL_FREE, WASABI_API_LNGSTRINGW(IDS_CALCULATING));
  214. HANDLE ht = CreateThread(NULL, 0, DiskFreeSpace_ThreadProc, pcs, 0, &threadId);
  215. if (NULL != ht)
  216. {
  217. CloseHandle(ht);
  218. StringCchCopy(ppd->szCurrentRoot, ARRAYSIZE(ppd->szCurrentRoot), pcs->szRoot);
  219. return;
  220. }
  221. SetDlgItemText(hdlg, IDC_LBL_FREE, TEXT(""));
  222. }
  223. }
  224. if (TEXT('\0') == *pcs->szRoot)
  225. {
  226. pcs->dwError = ERROR_INVALID_NAME;
  227. StringCchCopy(ppd->szCurrentRoot, ARRAYSIZE(ppd->szCurrentRoot), pcs->szRoot);
  228. PostMessage(pcs->hCallback, CPM_UPDATEDISKSIZE, 0, (LPARAM)pcs);
  229. return;
  230. }
  231. free(pcs);
  232. }
  233. static void CopyPrepare_OnUpdateDiskSizeResult(HWND hdlg, CALCDISKSIZE *pcs)
  234. {
  235. if (!pcs) return;
  236. PREPDLG *ppd = GetPrepDlg(hdlg);
  237. if (ppd && CSTR_EQUAL == CompareString(STRCOMP_INVARIANT, NORM_IGNORECASE, ppd->szCurrentRoot, -1, pcs->szRoot, -1))
  238. {
  239. TCHAR szBuffer[128] = {0};
  240. szBuffer[0] = TEXT('\0');
  241. if (ERROR_SUCCESS == pcs->dwError) StrFormatByteSize64(pcs->bytesFree.QuadPart, szBuffer, ARRAYSIZE(szBuffer));
  242. else WASABI_API_LNGSTRINGW_BUF(IDS_UNKNOWN, szBuffer, sizeof(szBuffer));
  243. SetDlgItemText(hdlg, IDC_LBL_FREE, szBuffer);
  244. }
  245. free(pcs);
  246. }
  247. static void CopyPrepare_OnOptionsClick(HWND hdlg)
  248. {
  249. RECT rw, rw2;
  250. BOOL bEnable;
  251. INT height;
  252. PREPDLG *ppd = GetPrepDlg(hdlg);
  253. HWND hctrl = GetDlgItem(hdlg, IDC_GRP_OPTIONS);
  254. if (!hctrl || !GetWindowRect(hctrl, &rw)) return;
  255. GetWindowRect(hdlg, &rw2);
  256. OffsetRect(&rw, -rw2.left, -rw2.top);
  257. if (WS_DISABLED & GetWindowLongPtrW(hctrl, GWL_STYLE))
  258. {
  259. height = rw.bottom + 8;
  260. bEnable = TRUE;
  261. Settings_SetDirectoryCtrl(C_COPY, CF_PATH, hdlg, IDC_EDT_PATH);
  262. Settings_SetCheckBox(C_COPY, CF_ADDTOMLDB, hdlg, IDC_CHK_ADDTOMLDB);
  263. Settings_SetCheckBox(C_COPY, CF_USETITLEFMT, hdlg, IDC_CHK_CUSTOMNAME);
  264. Settings_SetDlgItemText(C_COPY, CF_TITLEFMT, hdlg, IDC_EDT_NAMEFORMAT);
  265. SetDlgItemText(hdlg, IDC_BTN_OPTIONS, WASABI_API_LNGSTRINGW(IDS_OPTIONS_HIDE));
  266. if (ppd && NULL == ppd->pac)
  267. {
  268. HRESULT hr;
  269. hr = CoCreateInstance(CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, IID_IAutoComplete, (LPVOID*)&ppd->pac);
  270. if (S_OK == hr)
  271. {
  272. IAutoComplete2 *pac2;
  273. if (SUCCEEDED(ppd->pac->QueryInterface(IID_IAutoComplete2, (LPVOID*)&pac2)))
  274. {
  275. pac2->SetOptions(ACO_AUTOSUGGEST | ACO_AUTOAPPEND | 0x00000020/*ACF_UPDOWNKEYDROPSLIST*/);
  276. pac2->Release();
  277. }
  278. hr = CoCreateInstance(CLSID_ACListISF, NULL, CLSCTX_INPROC_SERVER, IID_IACList2, (LPVOID*)&ppd->pacl2);
  279. if (S_OK == hr) ppd->pacl2->SetOptions(ACLO_FILESYSDIRS);
  280. }
  281. if(ppd->pac) ppd->pac->Init(GetDlgItem(hdlg, IDC_EDT_PATH), ppd->pacl2, NULL, NULL);
  282. }
  283. }
  284. else
  285. {
  286. height = rw.top;
  287. bEnable = FALSE;
  288. SetDlgItemText(hdlg, IDC_BTN_OPTIONS, WASABI_API_LNGSTRINGW(IDS_OPTIONS_SHOW));
  289. }
  290. SetWindowPos(hdlg, NULL, 0, 0, rw2.right - rw2.left, height, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);
  291. EnableWindow(hctrl, bEnable);
  292. UINT szIdList[] = { IDC_EDT_PATH, IDC_BTN_BROWSE, IDC_CHK_ADDTOMLDB,
  293. IDC_CHK_CUSTOMNAME, IDC_EDT_NAMEFORMAT, IDC_BTN_HELP, };
  294. for (int i = 0; i < sizeof(szIdList)/sizeof(szIdList[0]); i++) EnableWindow(GetDlgItem(hdlg, szIdList[i]), bEnable);
  295. if (bEnable && BST_UNCHECKED == IsDlgButtonChecked(hdlg, IDC_CHK_CUSTOMNAME))
  296. {
  297. EnableWindow(GetDlgItem(hdlg, IDC_EDT_NAMEFORMAT), FALSE);
  298. ShowWindow(GetDlgItem(hdlg, IDC_LBL_EXAMPLE), SW_HIDE);
  299. ShowWindow(GetDlgItem(hdlg, IDC_LBL_EXAMPLE_TITLE), SW_HIDE);
  300. }
  301. }
  302. static INT_PTR CopyPrepare_OnHelp(HWND hdlg, HELPINFO *phi)
  303. {
  304. PREPDLG *ppd = GetPrepDlg(hdlg);
  305. if (ppd && 0 == (WS_DISABLED & GetWindowLongPtrW(GetDlgItem(hdlg, IDC_GRP_OPTIONS), GWL_STYLE)))
  306. {
  307. if (ppd->hActiveHelp) SetWindowPos(ppd->hActiveHelp, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
  308. else ppd->hActiveHelp = MLDisc_ShowHelp(hdlg, MAKEINTRESOURCE(IDS_COPY_FILENAME_FORMAT_TITLE),
  309. MAKEINTRESOURCE(IDS_COPY_FILENAME_FORMAT_CAPTION), MAKEINTRESOURCE(IDS_COPY_FILENAME_FORMAT), HF_ALLOWRESIZE);
  310. SetWindowLongPtrW(hdlg, DWLP_MSGRESULT, TRUE);
  311. return TRUE;
  312. }
  313. return FALSE;
  314. }
  315. INT_PTR CALLBACK CopyPrepare_DialogProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
  316. {
  317. switch(uMsg)
  318. {
  319. case WM_INITDIALOG: return CopyPrepare_OnInitDialog(hdlg, (HWND)wParam, lParam);
  320. case WM_DESTROY: CopyPrepare_OnDestroy(hdlg); break;
  321. case WM_PARENTNOTIFY: CopyPrepare_OnParentNotify(hdlg, LOWORD(wParam), lParam); break;
  322. case WM_HELP: return CopyPrepare_OnHelp(hdlg, (HELPINFO*)lParam);
  323. case CPM_UPDATEDISKSIZE: CopyPrepare_OnUpdateDiskSizeResult(hdlg, (CALCDISKSIZE*)lParam); break;
  324. case WM_COMMAND:
  325. switch(LOWORD(wParam))
  326. {
  327. case IDOK:
  328. case IDCANCEL:
  329. EndDialog(hdlg, LOWORD(wParam));
  330. break;
  331. case IDC_BTN_BROWSE: if (HIWORD(wParam) == BN_CLICKED) Settings_BrowseForFolder(C_COPY, CF_PATH, hdlg, IDC_EDT_PATH); break;
  332. case IDC_BTN_OPTIONS: if (HIWORD(wParam) == BN_CLICKED) CopyPrepare_OnOptionsClick(hdlg); break;
  333. case IDC_CHK_ADDTOMLDB: if (BN_CLICKED == HIWORD(wParam)) Settings_FromCheckBox(C_COPY, CF_ADDTOMLDB, hdlg, IDC_CHK_ADDTOMLDB); break;
  334. case IDC_CHK_CUSTOMNAME:
  335. if (BN_CLICKED == HIWORD(wParam))
  336. {
  337. Settings_FromCheckBox(C_COPY, CF_USETITLEFMT, hdlg, IDC_CHK_CUSTOMNAME);
  338. BOOL bEnable = (BST_UNCHECKED != IsDlgButtonChecked(hdlg, IDC_CHK_CUSTOMNAME));
  339. EnableWindow(GetDlgItem(hdlg, IDC_EDT_NAMEFORMAT), bEnable);
  340. ShowWindow(GetDlgItem(hdlg, IDC_LBL_EXAMPLE_TITLE), (bEnable) ? SW_SHOWNA : SW_HIDE);
  341. ShowWindow(GetDlgItem(hdlg, IDC_LBL_EXAMPLE), (bEnable) ? SW_SHOWNA : SW_HIDE);
  342. }
  343. break;
  344. case IDC_EDT_PATH:
  345. if (EN_CHANGE == HIWORD(wParam))
  346. {
  347. Settings_FromDirectoryCtrl(C_COPY, CF_PATH, hdlg, IDC_EDT_PATH);
  348. SetTimer(hdlg, TID_UPDATEDISKSIZE, DELAY_UPDATEDISKSIZE, CopyPrepare_OnUpdateDiskSizeTimer);
  349. }
  350. break;
  351. case IDC_EDT_NAMEFORMAT:
  352. if (EN_CHANGE == HIWORD(wParam))
  353. {
  354. Settings_FromDlgItemText(C_COPY, CF_TITLEFMT, hdlg, IDC_EDT_NAMEFORMAT);
  355. DisplayFormatExample(hdlg, IDC_LBL_EXAMPLE);
  356. }
  357. break;
  358. case IDC_BTN_HELP:
  359. if (HIWORD(wParam) == BN_CLICKED)
  360. {
  361. HELPINFO hi = {sizeof(HELPINFO), };
  362. hi.dwContextId = HELPINFO_WINDOW;
  363. hi.iCtrlId = IDC_EDT_NAMEFORMAT;
  364. hi.hItemHandle = GetDlgItem(hdlg, IDC_EDT_NAMEFORMAT);
  365. hi.iContextType = 0;
  366. hi.MousePos.x = 0; hi.MousePos.y = 0;
  367. SendMessageW(hdlg, WM_HELP, 0, (LPARAM)&hi);
  368. }
  369. break;
  370. }
  371. }
  372. return 0;
  373. }