ReactOS 0.4.15-dev-7788-g1ad9096
fontsub.cpp
Go to the documentation of this file.
1// FontSub by Katayama Hirofumi MZ
2//
3// To the extent possible under law, the person who associated CC0 with
4// FontSub has waived all copyright and related or neighboring rights
5// to FontSub.
6//
7// You should have received a copy of the CC0 legalcode along with this
8// work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
9
10
11#include <windows.h>
12#include <windowsx.h>
13#include <commctrl.h>
14#include <tchar.h>
15#include <vector> // for std::vector
16#include <set> // for std::set
17#include <string> // for std::basic_string
18#include <algorithm> // for std::sort
19#include <cstdio>
20#include <cstring>
21#include <cassert>
22#include "resource.h"
23
24
25#define NAME_COLUMN_WIDTH 250
26#define SUB_COLUMN_WIDTH 250
27#define MAX_STRING 120
28
29#ifndef _countof
30 #define _countof(array) (sizeof(array) / sizeof(array[0]))
31#endif
32
33typedef std::wstring STRING;
34
35struct ITEM
36{
40 BYTE CharSet1, BYTE CharSet2)
42 m_CharSet1(CharSet1), m_CharSet2(CharSet2) { }
43};
44
45/* global variables */
53
54LPCWSTR g_pszClassName = L"ReactOS Font Substitutes Editor";
55LPCWSTR g_pszFileHeader = L"Windows Registry Editor Version 5.00";
56
60
63
65 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes";
66
67typedef std::set<STRING> FONTNAMESET;
68typedef std::vector<ITEM> ITEMVECTOR;
69
76
77typedef struct CHARSET_ENTRY
78{
82
84{
85 { DEFAULT_CHARSET, L"DEFAULT_CHARSET (1)" },
86 { ANSI_CHARSET, L"ANSI_CHARSET (0)" },
87 { SYMBOL_CHARSET, L"SYMBOL_CHARSET (2)" },
88 { SHIFTJIS_CHARSET, L"SHIFTJIS_CHARSET (128)" },
89 { HANGUL_CHARSET, L"HANGUL_CHARSET (129)" },
90 { GB2312_CHARSET, L"GB2312_CHARSET (134)" },
91 { CHINESEBIG5_CHARSET, L"CHINESEBIG5_CHARSET (136)" },
92 { OEM_CHARSET, L"OEM_CHARSET (255)" },
93 { JOHAB_CHARSET, L"JOHAB_CHARSET (130)" },
94 { HEBREW_CHARSET, L"HEBREW_CHARSET (177)" },
95 { ARABIC_CHARSET, L"ARABIC_CHARSET (178)" },
96 { GREEK_CHARSET, L"GREEK_CHARSET (161)" },
97 { TURKISH_CHARSET, L"TURKISH_CHARSET (162)" },
98 { VIETNAMESE_CHARSET, L"VIETNAMESE_CHARSET (163)" },
99 { THAI_CHARSET, L"THAI_CHARSET (222)" },
100 { EASTEUROPE_CHARSET, L"EASTEUROPE_CHARSET (238)" },
101 { RUSSIAN_CHARSET, L"RUSSIAN_CHARSET (204)" },
102 { MAC_CHARSET, L"MAC_CHARSET (77)" },
103 { BALTIC_CHARSET, L"BALTIC_CHARSET (186)" }
104};
105const WCHAR g_LongestName[] = L"CHINESEBIG5_CHARSET (136)";
106
107static void trim(STRING& str)
108{
109 static const WCHAR Spaces[] = L" \t\r\n";
110 size_t i = str.find_first_not_of(Spaces);
111 size_t j = str.find_last_not_of(Spaces);
112 if (i == STRING::npos || j == STRING::npos)
113 {
114 str.clear();
115 }
116 else
117 {
118 str = str.substr(i, j - i + 1);
119 }
120}
121
122static int CALLBACK
124 const NEWTEXTMETRICW *pntm,
125 int FontType,
127{
128 switch (pelf->elfFullName[0])
129 {
130 case UNICODE_NULL: case L'@':
131 break;
132 default:
133 g_Names.insert((const WCHAR *)pelf->elfFullName);
134 }
135 switch (pelf->elfLogFont.lfFaceName[0])
136 {
137 case UNICODE_NULL: case L'@':
138 break;
139 default:
140 g_Names.insert(pelf->elfLogFont.lfFaceName);
141 }
142 return 1;
143}
144
146{
147 g_Names.clear();
148
149 LOGFONTW lf;
150 ZeroMemory(&lf, sizeof(lf));
152
155 DeleteDC(hDC);
156
157 return !g_Names.empty();
158}
159
160inline bool ItemCompareByNameAscend(const ITEM& Item1, const ITEM& Item2)
161{
162 return Item1.m_Name < Item2.m_Name;
163}
164
165inline bool ItemCompareByNameDescend(const ITEM& Item1, const ITEM& Item2)
166{
167 return Item1.m_Name > Item2.m_Name;
168}
169
170inline bool ItemCompareBySubAscend(const ITEM& Item1, const ITEM& Item2)
171{
172 return Item1.m_Substitute < Item2.m_Substitute;
173}
174
175inline bool ItemCompareBySubDescend(const ITEM& Item1, const ITEM& Item2)
176{
177 return Item1.m_Substitute > Item2.m_Substitute;
178}
179
180void DoSort(INT iColumn, BOOL bAscendant = TRUE)
181{
182 LV_COLUMN Column;
183 ZeroMemory(&Column, sizeof(Column));
184 Column.mask = LVCF_IMAGE | LVCF_SUBITEM;
185 Column.iImage = 2;
186 Column.iSubItem = 0;
187 ListView_SetColumn(g_hListView, 0, &Column);
188 Column.iSubItem = 1;
189 ListView_SetColumn(g_hListView, 1, &Column);
190
191 switch (iColumn)
192 {
193 case 0:
194 Column.iSubItem = 0;
195 if (bAscendant)
196 {
197 std::sort(g_Items.begin(), g_Items.end(),
199 Column.iImage = 0;
200 ListView_SetColumn(g_hListView, 0, &Column);
201 }
202 else
203 {
204 std::sort(g_Items.begin(), g_Items.end(),
206 Column.iImage = 1;
207 ListView_SetColumn(g_hListView, 0, &Column);
208 }
209 break;
210 case 1:
211 Column.iSubItem = 1;
212 if (bAscendant)
213 {
214 std::sort(g_Items.begin(), g_Items.end(),
216 Column.iImage = 0;
217 ListView_SetColumn(g_hListView, 1, &Column);
218 }
219 else
220 {
221 std::sort(g_Items.begin(), g_Items.end(),
223 Column.iImage = 1;
224 ListView_SetColumn(g_hListView, 1, &Column);
225 }
226 break;
227 }
228 g_iSortColumn = iColumn;
229 g_bSortAscendant = bAscendant;
231}
232
234{
236
238 ZeroMemory(&Item, sizeof(Item));
239 Item.mask = LVIF_PARAM;
240
241 const INT Count = INT(g_Items.size());
242 for (INT i = 0; i < Count; ++i)
243 {
244 Item.iItem = i;
245 Item.iSubItem = 0;
246 Item.lParam = i;
248
249 Item.iItem = i;
250 Item.iSubItem = 1;
251 Item.lParam = i;
253 }
254}
255
257{
258 ITEMVECTOR Items;
259
260 HKEY hKey = NULL;
262 if (hKey == NULL)
263 return FALSE;
264
266 DWORD cbName, cbValue;
267 for (DWORD dwIndex = 0; ; ++dwIndex)
268 {
269 cbName = sizeof(szName);
270 cbValue = sizeof(szValue);
271 LONG Error = RegEnumValueW(hKey, dwIndex, szName, &cbName,
272 NULL, NULL, (LPBYTE)szValue, &cbValue);
273 if (Error != ERROR_SUCCESS)
274 break;
275
276 BYTE CharSet1 = DEFAULT_CHARSET, CharSet2 = DEFAULT_CHARSET;
277 LPWSTR pch;
278
279 pch = wcsrchr(szName, L',');
280 if (pch)
281 {
282 *pch = 0;
283 CharSet1 = (BYTE)_wtoi(pch + 1);
284 }
285
286 pch = wcsrchr(szValue, L',');
287 if (pch)
288 {
289 *pch = 0;
290 CharSet2 = (BYTE)_wtoi(pch + 1);
291 }
292
293 ITEM Item(szName, szValue, CharSet1, CharSet2);
294 trim(Item.m_Name);
295 trim(Item.m_Substitute);
296 Items.push_back(Item);
297 }
298
300
301 g_Items = Items;
303 DoSort(0, TRUE);
306
307 return !g_Items.empty();
308}
309
311{
312 return DoLoadNames() && DoLoadItems();
313}
314
316{
317 if (iRow == -1)
319 if (iRow == -1)
320 return;
321
322 RECT Rect;
323 LPRECT GccIsWhining = &Rect;
324 ListView_GetItemRect(hwnd, iRow, GccIsWhining, LVIR_BOUNDS);
326}
327
329{
332
333 HIMAGELIST hImageList;
334 hImageList = ImageList_Create(12, 12, ILC_COLOR8 | ILC_MASK, 2, 2);
335
336 HBITMAP hbm;
339 assert(hbm);
340 ImageList_AddMasked(hImageList, hbm, RGB(192, 192, 192));
342
345 assert(hbm);
346 ImageList_AddMasked(hImageList, hbm, RGB(192, 192, 192));
348
351 assert(hbm);
352 ImageList_AddMasked(hImageList, hbm, RGB(192, 192, 192));
354
356
357 LV_COLUMNW Column;
358 ZeroMemory(&Column, sizeof(Column));
360 Column.fmt = LVCFMT_LEFT;
361
362 Column.cx = NAME_COLUMN_WIDTH;
363 Column.pszText = g_szNameHead;
364 Column.iSubItem = 0;
365 Column.iImage = 0;
366 ListView_InsertColumn(hwnd, 0, &Column);
367
368 Column.cx = SUB_COLUMN_WIDTH;
369 Column.pszText = g_szSubstituteHead;
370 Column.iSubItem = 1;
371 Column.iImage = 2;
372 ListView_InsertColumn(hwnd, 1, &Column);
373
376
377 return TRUE;
378}
379
381{
383 ZeroMemory(&Item, sizeof(Item));
384 Item.mask = CBEIF_TEXT;
385
386 FONTNAMESET::iterator it, end = g_Names.end();
387 for (it = g_Names.begin(); it != end; ++it)
388 {
389 Item.pszText = const_cast<LPWSTR>(it->c_str());
392 }
395
397 for (INT i = 0; i < Count; ++i)
398 {
399 Item.pszText = const_cast<LPWSTR>(g_CharSetList[i].DisplayName);
404 }
405
408 for (INT i = 0; i < Count; ++i)
409 {
411 {
413 }
415 {
417 }
418 }
419
420 SIZE siz;
424 DeleteDC(hDC);
425
428
430
431 return TRUE;
432}
433
434void LV_OnDelete(HWND hwnd, INT iRow = -1)
435{
436 if (iRow == -1)
438 if (iRow == -1)
439 return;
440
443
444 WCHAR sz[MAX_STRING];
448 {
449 return;
450 }
451
453 g_Items.erase(g_Items.begin() + iRow);
455
457
459}
460
461void EditDlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
462{
463 WCHAR szValue[MAX_STRING];
464 STRING str;
465 INT i;
466
467 switch (id)
468 {
469 case IDOK:
470 GetDlgItemTextW(hwnd, cmb2, szValue, _countof(szValue));
471 str = szValue;
472 trim(str);
473 if (str.empty())
474 {
475 WCHAR sz[MAX_STRING];
480 return;
481 }
482
483 g_Items[g_iItem].m_CharSet2 = DEFAULT_CHARSET;
485 if (i != CB_ERR)
486 {
487 g_Items[g_iItem].m_CharSet2 = g_CharSetList[i].CharSet;
488 }
489 g_Items[g_iItem].m_Substitute = str;
490
493 break;
494 case IDCANCEL:
496 break;
497 case psh1:
500 break;
501 }
502}
503
506{
507 switch (uMsg)
508 {
511 }
512 return 0;
513}
514
516{
518 if (g_iItem == -1)
519 return;
520
521 g_strFontName = g_Items[g_iItem].m_Name;
522 g_strSubstitute = g_Items[g_iItem].m_Substitute;
523 g_CharSet1 = g_Items[g_iItem].m_CharSet1;
524 g_CharSet2 = g_Items[g_iItem].m_CharSet2;
525
529}
530
532{
533 DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_VSCROLL |
535 DWORD dwExStyle = WS_EX_CLIENTEDGE;
536 g_hListView = CreateWindowEx(dwExStyle, WC_LISTVIEW, NULL, dwStyle,
537 0, 0, 0, 0,
538 hwnd, (HMENU)1, g_hInstance, NULL);
539 if (g_hListView == NULL)
540 return FALSE;
541
542 if (!LV_Init(g_hListView))
543 return FALSE;
544
545 if (!DoLoad())
546 return FALSE;
547
551 return TRUE;
552}
553
555{
557 ZeroMemory(&Item, sizeof(Item));
558 Item.iItem = -1;
559 Item.mask = CBEIF_TEXT;
560
561 FONTNAMESET::iterator it, end = g_Names.end();
562 for (it = g_Names.begin(); it != end; ++it)
563 {
564 Item.pszText = const_cast<LPWSTR>(it->c_str());
569 }
570 WCHAR szEnterName[MAX_STRING];
571 LoadStringW(g_hInstance, IDS_ENTERNAME, szEnterName, _countof(szEnterName));
572 SetDlgItemTextW(hwnd, cmb1, szEnterName);
574
576 for (INT i = 0; i < Count; ++i)
577 {
578 Item.pszText = const_cast<LPWSTR>(g_CharSetList[i].DisplayName);
583 }
584
587 for (INT i = 0; i < Count; ++i)
588 {
590 {
592 }
594 {
596 }
597 }
598
599 SIZE siz;
603 DeleteDC(hDC);
604
607
608 return TRUE;
609}
610
611void AddDlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
612{
613 WCHAR szKey[MAX_STRING], szValue[MAX_STRING], sz[MAX_STRING];
614 INT i, iCharSet1, iCharSet2;
615 BYTE CharSet1, CharSet2;
617 switch (id)
618 {
619 case IDOK:
620 GetDlgItemTextW(hwnd, cmb1, szKey, _countof(szKey));
621 key = szKey;
622 trim(key);
624 if (key.empty() || key == sz)
625 {
630 return;
631 }
632
633 GetDlgItemTextW(hwnd, cmb2, szValue, _countof(szValue));
634 value = szValue;
635 trim(value);
636 if (value.empty())
637 {
642 return;
643 }
644
645 iCharSet1 = SendDlgItemMessageW(hwnd, cmb3, CB_GETCURSEL, 0, 0);
646 if (iCharSet1 == CB_ERR)
647 iCharSet1 = 0;
648 iCharSet2 = SendDlgItemMessageW(hwnd, cmb4, CB_GETCURSEL, 0, 0);
649 if (iCharSet2 == CB_ERR)
650 iCharSet2 = 0;
651
652 CharSet1 = g_CharSetList[iCharSet1].CharSet;
653 CharSet2 = g_CharSetList[iCharSet2].CharSet;
654
655 for (i = 0; i < (INT)g_Items.size(); ++i)
656 {
657 if (g_Items[i].m_Name == key &&
658 g_Items[i].m_CharSet1 == CharSet1)
659 {
660 WCHAR sz[MAX_STRING];
665 return;
666 }
667 }
668 {
669 ITEM Item(key, value, CharSet1, CharSet2);
670 g_Items.push_back(Item);
672
673 i = (INT)g_Items.size();
674 LV_ITEM LvItem;
675 ZeroMemory(&LvItem, sizeof(LvItem));
676 LvItem.mask = LVIF_PARAM;
677 LvItem.iItem = i;
678 LvItem.lParam = i;
679
680 LvItem.iSubItem = 0;
682
683 LvItem.iSubItem = 1;
685 }
688 break;
689 case IDCANCEL:
691 break;
692 }
693}
694
697{
698 switch (uMsg)
699 {
702 }
703 return 0;
704}
705
707{
709 if (g_iItem == -1)
710 return;
711
712 g_strFontName = g_Items[g_iItem].m_Name;
713 g_strSubstitute = g_Items[g_iItem].m_Substitute;
714 g_CharSet1 = g_Items[g_iItem].m_CharSet1;
715 g_CharSet2 = g_Items[g_iItem].m_CharSet2;
716
719 {
724 }
725}
726
728{
729 // open the key
730 HKEY hKey = NULL;
732 if (hKey == NULL)
733 return FALSE;
734
735 // clear all values
737 DWORD cbName, cbValue;
738 for (;;)
739 {
740 cbName = sizeof(szName);
741 cbValue = sizeof(szValue);
742 LONG Error = RegEnumValueW(hKey, 0, szName, &cbName,
743 NULL, NULL, (LPBYTE)szValue, &cbValue);
744 if (Error != ERROR_SUCCESS)
745 break;
746
748 }
749
750 // set values
751 size_t Count = g_Items.size();
752 for (size_t i = 0; i < Count; ++i)
753 {
754 DWORD cbData = (g_Items[i].m_Substitute.size() + 1) * sizeof(WCHAR);
755 RegSetValueExW(hKey, g_Items[i].m_Name.c_str(), 0,
756 REG_SZ, (LPBYTE)g_Items[i].m_Substitute.c_str(), cbData);
757 }
758
759 // close now
761
764 return TRUE;
765}
766
768{
769 while (*pch && wcschr(L" \t\r\n", *pch) != NULL)
770 {
771 ++pch;
772 }
773 return const_cast<LPWSTR>(pch);
774}
775
777{
778 ++pch; // L'"'
779 while (*pch)
780 {
781 if (*pch == L'"')
782 {
783 ++pch;
784 break;
785 }
786 if (*pch == L'\\')
787 {
788 ++pch;
789 }
790 ++pch;
791 }
792 return pch;
793}
794
795void UnescapeHex(const STRING& str, size_t& i, STRING& Ret, BOOL Unicode)
796{
797 STRING Num;
798
799 // hexadecimal
800 if (iswxdigit(str[i]))
801 {
802 Num += str[i];
803 ++i;
804 if (iswxdigit(str[i]))
805 {
806 Num += str[i];
807 ++i;
808 if (Unicode)
809 {
810 if (iswxdigit(str[i]))
811 {
812 Num += str[i];
813 ++i;
814 if (iswxdigit(str[i]))
815 {
816 Num += str[i];
817 ++i;
818 }
819 }
820 }
821 }
822 }
823 if (!Num.empty())
824 {
825 Ret += (WCHAR)wcstoul(&Num[0], NULL, 16);
826 }
827}
828
829void UnescapeOther(const STRING& str, size_t& i, STRING& Ret)
830{
831 STRING Num;
832
833 // check octal
834 if (L'0' <= str[i] && str[i] < L'8')
835 {
836 Num += str[i];
837 ++i;
838 if (L'0' <= str[i] && str[i] < L'8')
839 {
840 Num += str[i];
841 ++i;
842 if (L'0' <= str[i] && str[i] < L'8')
843 {
844 Num += str[i];
845 ++i;
846 }
847 }
848 }
849 if (Num.empty())
850 {
851 Ret += str[i];
852 ++i;
853 }
854 else
855 {
856 // octal
857 Ret += (WCHAR)wcstoul(&Num[0], NULL, 8);
858 }
859}
860
861// process escape sequence
862void UnescapeChar(const STRING& str, size_t& i, STRING& Ret)
863{
864 if (str[i] != L'\\')
865 {
866 Ret += str[i];
867 ++i;
868 return;
869 }
870
871 ++i;
872 switch (str[i])
873 {
874 case L'a': Ret += L'\a'; ++i; break;
875 case L'b': Ret += L'\b'; ++i; break;
876 case L'f': Ret += L'\f'; ++i; break;
877 case L'n': Ret += L'\n'; ++i; break;
878 case L'r': Ret += L'\r'; ++i; break;
879 case L't': Ret += L'\t'; ++i; break;
880 case L'v': Ret += L'\v'; ++i; break;
881 case L'x':
882 // hexidemical
883 ++i;
884 UnescapeHex(str, i, Ret, FALSE);
885 break;
886 case L'u':
887 // Unicode hexidemical
888 ++i;
889 UnescapeHex(str, i, Ret, TRUE);
890 break;
891 default:
892 // other case
893 UnescapeOther(str, i, Ret);
894 break;
895 }
896}
897
899{
900 if (str[0] != L'"')
901 return str;
902
903 STRING Ret;
904 size_t i = 1;
905 while (i < str.size())
906 {
907 if (str[i] == L'"' || str[i] == UNICODE_NULL)
908 break;
909
910 UnescapeChar(str, i, Ret);
911 }
912 return Ret;
913}
914
916{
917 ITEMVECTOR Items;
918
919 LPWSTR pch, pchSep, pchStart = (LPWSTR)pvContents;
920
921 pchStart[dwSize / sizeof(WCHAR)] = UNICODE_NULL;
922
923 // check header
924 const DWORD cbHeader = lstrlenW(g_pszFileHeader) * sizeof(WCHAR);
925 if (memcmp(pchStart, g_pszFileHeader, cbHeader) != 0)
926 return FALSE;
927
928 pchStart += cbHeader / sizeof(WCHAR);
929
930 // find the key
931 WCHAR szKey[MAX_STRING];
932 wsprintfW(szKey, L"[HKEY_LOCAL_MACHINE\\%s]", g_pszKey);
933 pch = wcsstr(pchStart, szKey);
934 if (pch == NULL)
935 return FALSE;
936
937 pchStart = pch + lstrlenW(szKey);
938
939 for (;;)
940 {
941 pchStart = SkipSpace(pchStart);
942 if (*pchStart == UNICODE_NULL || *pchStart == L'[')
943 break;
944
945 pch = wcschr(pchStart, L'\n');
946 if (pch)
947 *pch = UNICODE_NULL;
948
949 pchSep = SkipQuoted(pchStart);
950 if (*pchSep == L'=')
951 {
952 *pchSep = UNICODE_NULL;
953
954 STRING key = pchStart;
955 trim(key);
956 key = Unquote(key);
957
958 STRING value = pchSep + 1;
959 trim(value);
961
962 BYTE CharSet1 = DEFAULT_CHARSET, CharSet2 = DEFAULT_CHARSET;
963
964 size_t pos;
965 pos = key.find(L',');
966 if (pos != STRING::npos)
967 {
968 CharSet1 = (BYTE)_wtoi(&key[pos + 1]);
969 key.resize(pos);
970 trim(key);
971 }
972 pos = value.find(L',');
973 if (pos != STRING::npos)
974 {
975 CharSet2 = (BYTE)_wtoi(&value[pos + 1]);
976 value.resize(pos);
977 trim(value);
978 }
979
980 ITEM Item(key, value, CharSet1, CharSet2);
981 Items.push_back(Item);
982 }
983
984 if (pch == NULL)
985 break;
986
987 pchStart = pch + 1;
988 }
989
990 g_Items = Items;
992
994 return TRUE;
995}
996
998{
1003 return FALSE;
1004
1007 if (dwSize != 0xFFFFFFFF)
1008 {
1009 std::vector<BYTE> Contents(dwSize + 2);
1010 DWORD cbRead;
1011 if (ReadFile(hFile, &Contents[0], dwSize, &cbRead, NULL) &&
1012 cbRead == dwSize)
1013 {
1014 /* check BOM */
1015 if (memcmp(&Contents[0], "\xFF\xFE", 2) == 0)
1016 {
1017 bSuccess = DoParseFile(&Contents[2], dwSize - 2);
1018 }
1019 else
1020 {
1021 bSuccess = DoParseFile(&Contents[0], dwSize);
1022 }
1023 }
1024 }
1026
1027 return bSuccess;
1028}
1029
1031{
1032 STRING Ret;
1033 for (size_t i = 0; i < str.size(); ++i)
1034 {
1035 switch (str[i])
1036 {
1037 case L'"': case L'\\':
1038 Ret += L'\\';
1039 Ret += str[i];
1040 break;
1041 default:
1042 Ret += str[i];
1043 }
1044 }
1045 return Ret;
1046}
1047
1049{
1054 return FALSE;
1055
1056 BOOL bSuccess;
1057 DWORD dwSize, cbWritten;
1058 WCHAR szCharSet1[MAX_STRING], szCharSet2[MAX_STRING];
1059 WCHAR szLine[MAX_STRING * 2 + 4];
1060
1061 /* write header */
1062 dwSize = lstrlenW(g_pszFileHeader) * sizeof(WCHAR);
1063 bSuccess =
1064 WriteFile(hFile, "\xFF\xFE", 2, &cbWritten, NULL) &&
1065 WriteFile(hFile, g_pszFileHeader, dwSize, &cbWritten, NULL);
1066 if (bSuccess)
1067 {
1068 wsprintfW(szLine, L"\r\n\r\n[HKEY_LOCAL_MACHINE\\%s]\r\n", g_pszKey);
1069 dwSize = lstrlenW(szLine) * sizeof(WCHAR);
1070 bSuccess = WriteFile(hFile, szLine, dwSize, &cbWritten, NULL);
1071 }
1072 if (bSuccess)
1073 {
1074 size_t i, Count = g_Items.size();
1075 for (i = 0; i < Count; ++i)
1076 {
1077 if (g_Items[i].m_CharSet1 != DEFAULT_CHARSET)
1078 wsprintfW(szCharSet1, L",%u", g_Items[i].m_CharSet1);
1079 else
1080 szCharSet1[0] = UNICODE_NULL;
1081
1082 if (g_Items[i].m_CharSet2 != DEFAULT_CHARSET)
1083 wsprintfW(szCharSet2, L",%u", g_Items[i].m_CharSet2);
1084 else
1085 szCharSet2[0] = UNICODE_NULL;
1086
1087 STRING Name = Escape(g_Items[i].m_Name);
1088 STRING Substitute = Escape(g_Items[i].m_Substitute);
1089 wsprintfW(szLine, L"\"%s%s\"=\"%s%s\"\r\n",
1090 Name.c_str(), szCharSet1,
1091 Substitute.c_str(), szCharSet2);
1092
1093 dwSize = lstrlenW(szLine) * sizeof(WCHAR);
1094 if (!WriteFile(hFile, szLine, dwSize, &cbWritten, NULL))
1095 {
1096 bSuccess = FALSE;
1097 break;
1098 }
1099 }
1100 WriteFile(hFile, L"\r\n", 2 * sizeof(WCHAR), &cbWritten, NULL);
1101 }
1103
1104 if (!bSuccess)
1105 {
1106 DeleteFileW(pszFile);
1107 }
1108
1109 return bSuccess;
1110}
1111
1112void MakeFilter(LPWSTR pszFilter)
1113{
1114 while (*pszFilter)
1115 {
1116 if (*pszFilter == L'|')
1117 *pszFilter = 0;
1118
1119 ++pszFilter;
1120 }
1121}
1122
1124{
1125 OPENFILENAMEW ofn = {0};
1126 WCHAR szFile[MAX_PATH] = L"";
1127 WCHAR szImportTitle[MAX_STRING];
1128 WCHAR szCannotImport[MAX_STRING];
1129 WCHAR szImportFilter[MAX_STRING];
1130 LoadStringW(g_hInstance, IDS_IMPORT, szImportTitle, _countof(szImportTitle));
1131 LoadStringW(g_hInstance, IDS_CANTIMPORT, szCannotImport, _countof(szCannotImport));
1132 LoadStringW(g_hInstance, IDS_INPFILTER, szImportFilter, _countof(szImportFilter));
1133 MakeFilter(szImportFilter);
1134
1136 ofn.hwndOwner = hwnd;
1137 ofn.lpstrFilter = szImportFilter;
1138 ofn.lpstrFile = szFile;
1139 ofn.nMaxFile = _countof(szFile);
1140 ofn.lpstrTitle = szImportTitle;
1145 ofn.lpstrDefExt = L"reg";
1146 if (GetOpenFileNameW(&ofn))
1147 {
1148 if (!DoImport(hwnd, szFile))
1149 {
1150 MessageBoxW(hwnd, szCannotImport, g_szTitle, MB_ICONERROR);
1151 }
1152 }
1153}
1154
1156{
1157 OPENFILENAMEW ofn = {0};
1158 WCHAR szFile[MAX_PATH] = L"";
1159 WCHAR szExportTitle[MAX_STRING];
1160 WCHAR szCannotExport[MAX_STRING];
1161 WCHAR szExportFilter[MAX_STRING];
1162 LoadStringW(g_hInstance, IDS_EXPORT, szExportTitle, _countof(szExportTitle));
1163 LoadStringW(g_hInstance, IDS_CANTEXPORT, szCannotExport, _countof(szCannotExport));
1164 LoadStringW(g_hInstance, IDS_OUTFILTER, szExportFilter, _countof(szExportFilter));
1165 MakeFilter(szExportFilter);
1166
1168 ofn.hwndOwner = hwnd;
1169 ofn.lpstrFilter = szExportFilter;
1170 ofn.lpstrFile = szFile;
1171 ofn.nMaxFile = _countof(szFile);
1172 ofn.lpstrTitle = szExportTitle;
1176 ofn.lpstrDefExt = L"reg";
1177 if (GetSaveFileNameW(&ofn))
1178 {
1179 if (!DoExport(hwnd, szFile))
1180 {
1181 MessageBoxW(hwnd, szCannotExport, g_szTitle, MB_ICONERROR);
1182 }
1183 }
1184}
1185
1187{
1188 DoLoad();
1189}
1190
1192{
1194}
1195
1197{
1199}
1200
1202{
1203 static const WCHAR s_szRegeditKey[] =
1204 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit";
1205 WCHAR sz[MAX_STRING];
1206
1207 // open regedit key
1208 HKEY hKey = NULL;
1209 LSTATUS Result = RegCreateKeyExW(HKEY_CURRENT_USER, s_szRegeditKey, 0,
1210 NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
1211 if (Result != ERROR_SUCCESS)
1212 {
1215 return;
1216 }
1217
1218 // set LastKey value
1219 wsprintfW(sz, L"HKEY_LOCAL_MACHINE\\%s", g_pszKey);
1220 DWORD dwSize = sizeof(sz);
1221 Result = RegSetValueExW(hKey, L"LastKey", 0, REG_SZ,
1222 (LPBYTE)sz, dwSize);
1223
1224 // close now
1226
1227 if (Result != ERROR_SUCCESS)
1228 {
1231 return;
1232 }
1233
1234 // open by regedit
1235 ShellExecuteW(hwnd, NULL, L"regedit.exe", NULL, NULL, SW_SHOWNORMAL);
1236}
1237
1239{
1240 WCHAR szAbout[MAX_PATH];
1241 LoadStringW(g_hInstance, IDS_ABOUT, szAbout, _countof(szAbout));
1242
1244 ZeroMemory(&Params, sizeof(Params));
1245 Params.cbSize = sizeof(Params);
1246 Params.hwndOwner = hwnd;
1247 Params.hInstance = g_hInstance;
1248 Params.lpszText = szAbout;
1249 Params.lpszCaption = g_szTitle;
1250 Params.dwStyle = MB_OK | MB_USERICON;
1251 Params.lpszIcon = MAKEINTRESOURCEW(1);
1252 Params.dwLanguageId = LANG_USER_DEFAULT;
1254}
1255
1256void MainWnd_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
1257{
1258 switch (id)
1259 {
1260 case ID_NEW:
1262 break;
1263 case ID_EDIT:
1265 break;
1266 case ID_EXIT:
1267 PostMessage(hwnd, WM_CLOSE, 0, 0);
1268 break;
1269 case ID_RELOAD:
1271 break;
1272 case ID_UPDATE_REGISTRY:
1274 break;
1275 case ID_DELETE:
1277 break;
1278 case ID_IMPORT:
1280 break;
1281 case ID_EXPORT:
1283 break;
1284 case ID_OPEN_REGKEY:
1286 break;
1287 case ID_ABOUT:
1289 break;
1290 }
1291}
1292
1294{
1295 PostQuitMessage(0);
1296}
1297
1299{
1300 MoveWindow(g_hListView, 0, 0, cx, cy, TRUE);
1301}
1302
1304{
1305 if (lpDrawItem->CtlType != ODT_LISTVIEW)
1306 return;
1307
1308 HDC hDC = lpDrawItem->hDC;
1310
1311 INT iColumn = 0, x, cx;
1312 RECT rcItem, rcSubItem, rcText;
1313 STRING Str;
1314
1316
1317 rcItem = lpDrawItem->rcItem;
1318 if (lpDrawItem->itemState & ODS_SELECTED)
1319 {
1320 FillRect(hDC, &rcItem, (HBRUSH)(COLOR_HIGHLIGHT + 1));
1322 }
1323 else
1324 {
1325 FillRect(hDC, &rcItem, (HBRUSH)(COLOR_WINDOW + 1));
1327 }
1328
1330 rcSubItem = rcItem;
1331 rcSubItem.left = x;
1332 rcSubItem.right = x + cx;
1333
1334 WCHAR sz[MAX_STRING];
1335
1336 rcText = rcSubItem;
1337 InflateRect(&rcText, -1, -1);
1338 Str = g_Items[lpDrawItem->itemID].m_Name;
1339 BYTE CharSet1 = g_Items[lpDrawItem->itemID].m_CharSet1;
1340 if (CharSet1 != DEFAULT_CHARSET)
1341 wsprintfW(sz, L"%s,%u", Str.c_str(), CharSet1);
1342 else
1343 wsprintfW(sz, L"%s", Str.c_str());
1344
1345 DrawTextW(hDC, sz, lstrlenW(sz), &rcText,
1347 DT_NOPREFIX);
1348
1349 x += cx;
1350 ++iColumn;
1351
1353 rcSubItem = rcItem;
1354 rcSubItem.left = x;
1355 rcSubItem.right = x + cx;
1356
1357 rcText = rcSubItem;
1358 InflateRect(&rcText, -1, -1);
1359 Str = g_Items[lpDrawItem->itemID].m_Substitute;
1360 BYTE CharSet2 = g_Items[lpDrawItem->itemID].m_CharSet2;
1361 if (CharSet2 != DEFAULT_CHARSET)
1362 wsprintfW(sz, L"%s,%u", Str.c_str(), CharSet2);
1363 else
1364 wsprintfW(sz, L"%s", Str.c_str());
1365
1366 DrawTextW(hDC, sz, lstrlenW(sz), &rcText,
1368 DT_NOPREFIX);
1369}
1370
1372{
1373 if (lpMeasureItem->CtlType != ODT_LISTVIEW)
1374 return;
1375
1376 TEXTMETRIC tm;
1377 HDC hDC = GetDC(hwnd);
1379 ReleaseDC(hwnd, hDC);
1380
1381 lpMeasureItem->itemHeight = tm.tmHeight * 4 / 3;
1382}
1383
1385{
1386 NM_LISTVIEW *pNMLV = (NM_LISTVIEW *)pnmhdr;
1387 LV_KEYDOWN *pLVKD = (LV_KEYDOWN *)pnmhdr;
1388
1389 switch (pnmhdr->code)
1390 {
1391 case LVN_COLUMNCLICK:
1392 if (pNMLV->iSubItem == g_iSortColumn)
1393 DoSort(pNMLV->iSubItem, !g_bSortAscendant);
1394 else
1395 DoSort(pNMLV->iSubItem, TRUE);
1396 break;
1397 case NM_DBLCLK:
1399 break;
1400 case LVN_KEYDOWN:
1401 if (pLVKD->wVKey == VK_RETURN) // [Enter] key
1402 {
1404 }
1405 if (pLVKD->wVKey == VK_DELETE) // [Del] key
1406 {
1408 }
1409 break;
1410 }
1411 return 0;
1412}
1413
1415{
1416 POINT pt = {(INT)xPos, (INT)yPos};
1419
1421 if (hMenu == NULL)
1422 return 0;
1423
1424 HMENU hSubMenu = GetSubMenu(hMenu, 0);
1425 if (hSubMenu == NULL)
1426 return 0;
1427
1430 xPos, yPos, 0, g_hMainWnd, NULL);
1432 return 0;
1433}
1434
1435void MainWnd_OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
1436{
1437 if (state != WA_INACTIVE)
1438 {
1440 }
1441}
1442
1444{
1445 HANDLE hToken;
1446 LUID luid;
1447 TOKEN_PRIVILEGES tokenPrivileges;
1448 BOOL Ret;
1449
1452 &hToken);
1453 if (!Ret)
1454 return Ret; // failure
1455
1456 Ret = ::LookupPrivilegeValueW(NULL, lpPrivilegeName, &luid);
1457 if (Ret)
1458 {
1459 tokenPrivileges.PrivilegeCount = 1;
1460 tokenPrivileges.Privileges[0].Luid = luid;
1461 tokenPrivileges.Privileges[0].Attributes = bEnable ? SE_PRIVILEGE_ENABLED : 0;
1462
1463 Ret = ::AdjustTokenPrivileges(hToken, FALSE, &tokenPrivileges, 0, 0, 0);
1464 }
1465
1466 ::CloseHandle(hToken);
1467 return Ret;
1468}
1469
1471{
1472 if (!g_bNeedsReboot && !g_bModified)
1473 {
1475 return;
1476 }
1477
1478 if (g_bModified)
1479 {
1480 WCHAR szUpdateNow[MAX_STRING];
1481 LoadStringW(g_hInstance, IDS_QUERYUPDATE, szUpdateNow, _countof(szUpdateNow));
1482 INT id = MessageBoxW(hwnd, szUpdateNow, g_szTitle,
1484 switch (id)
1485 {
1486 case IDYES:
1488 break;
1489 case IDNO:
1490 break;
1491 case IDCANCEL:
1492 return;
1493 }
1494 }
1495
1496 if (g_bNeedsReboot)
1497 {
1498 WCHAR szRebootNow[MAX_STRING];
1499 LoadStringW(g_hInstance, IDS_REBOOTNOW, szRebootNow, _countof(szRebootNow));
1500 INT id = MessageBoxW(hwnd, szRebootNow, g_szTitle,
1502 switch (id)
1503 {
1504 case IDYES:
1507 break;
1508 case IDNO:
1509 break;
1510 case IDCANCEL:
1511 return;
1512 }
1513 }
1514
1516}
1517
1520{
1521 switch (uMsg)
1522 {
1533 default:
1534 return DefWindowProc(hwnd, uMsg, wParam, lParam);
1535 }
1536}
1537
1540 HINSTANCE hPrevInstance,
1541 LPWSTR lpCmdLine,
1542 INT nCmdShow)
1543{
1546
1548
1552
1553 WNDCLASSW wc = {0};
1554 wc.style = 0;
1556 wc.hInstance = hInstance;
1558 wc.hIcon = g_hIcon;
1560 wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
1563 if (!RegisterClassW(&wc))
1564 {
1565 MessageBoxA(NULL, "ERROR: RegisterClass failed.", NULL, MB_ICONERROR);
1566 return 1;
1567 }
1568
1569 const DWORD dwStyle = WS_OVERLAPPEDWINDOW;
1573 INT Height = 320;
1574
1575 RECT Rect = { 0, 0, Width, Height };
1576 AdjustWindowRect(&Rect, dwStyle, TRUE);
1577 Width = Rect.right - Rect.left;
1578 Height = Rect.bottom - Rect.top;
1579
1582 NULL, NULL, hInstance, NULL);
1583 if (g_hMainWnd == NULL)
1584 {
1585 MessageBoxA(NULL, "ERROR: CreateWindow failed.", NULL, MB_ICONERROR);
1586 return 2;
1587 }
1588
1589 ShowWindow(g_hMainWnd, nCmdShow);
1591
1592 MSG msg;
1593 while (GetMessage(&msg, NULL, 0, 0))
1594 {
1596 continue;
1597
1600 }
1601
1602 return (INT)msg.wParam;
1603}
static HDC hDC
Definition: 3dtext.c:33
static VOID Substitute(_Out_writes_bytes_(BufferSize) PWCHAR Buffer, _In_ ULONG BufferSize, _In_ PCWSTR Template, _In_ PCWSTR SystemDriveName, _In_ PCWSTR SystemRootName)
Definition: IoFilesystem.c:231
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static int state
Definition: maze.c:121
#define msg(x)
Definition: auth_time.c:54
#define IDS_TITLE
Definition: resource.h:30
#define IDS_ABOUT
Definition: resource.h:29
#define ID_EXIT
Definition: resource.h:10
#define ID_DELETE
Definition: resource.h:25
#define ID_EXPORT
Definition: resource.h:17
#define ID_EDIT
Definition: resource.h:23
#define IDS_FONTNAME
Definition: resource.h:11
BOOL Error
Definition: chkdsk.c:66
#define RegCloseKey(hKey)
Definition: registry.h:49
HINSTANCE hInstance
Definition: charmap.c:19
#define ID_ABOUT
Definition: charmap.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_DONTADDTORECENT
Definition: commdlg.h:98
#define OPENFILENAME_SIZE_VERSION_400
Definition: commdlg.h:402
#define OFN_LONGNAMES
Definition: commdlg.h:108
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_ENABLESIZING
Definition: commdlg.h:101
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define cmb1
Definition: dlgs.h:48
#define psh1
Definition: dlgs.h:112
#define edt1
Definition: dlgs.h:65
#define cmb3
Definition: dlgs.h:50
#define cmb4
Definition: dlgs.h:51
#define cmb2
Definition: dlgs.h:49
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDD_ADD
Definition: resource.h:17
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3362
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4911
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2361
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2859
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
Definition: filedlg.c:4736
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
Definition: filedlg.c:4801
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define wcsrchr
Definition: compat.h:16
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GetCurrentProcess()
Definition: compat.h:759
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define CALLBACK
Definition: compat.h:35
#define FILE_SHARE_READ
Definition: compat.h:136
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
static void CharSet(RTF_Info *info)
Definition: reader.c:2420
#define assert(x)
Definition: debug.h:53
#define pt(x, y)
Definition: drawing.c:79
static BOOLEAN bSuccess
Definition: drive.cpp:433
#define RGB(r, g, b)
Definition: precomp.h:62
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SUB_COLUMN_WIDTH
Definition: fontsub.cpp:26
INT g_iSortColumn
Definition: fontsub.cpp:61
INT g_iItem
Definition: fontsub.cpp:52
CHARSET_ENTRY g_CharSetList[]
Definition: fontsub.cpp:83
void MainWnd_OnImport(HWND hwnd)
Definition: fontsub.cpp:1123
std::wstring STRING
Definition: fontsub.cpp:33
void LV_OnDelete(HWND hwnd, INT iRow=-1)
Definition: fontsub.cpp:434
STRING g_strSubstitute
Definition: fontsub.cpp:73
STRING Escape(const STRING &str)
Definition: fontsub.cpp:1030
BOOL DoExport(HWND hwnd, LPCWSTR pszFile)
Definition: fontsub.cpp:1048
LPWSTR SkipQuoted(LPWSTR pch)
Definition: fontsub.cpp:776
BYTE g_CharSet2
Definition: fontsub.cpp:75
BYTE g_CharSet1
Definition: fontsub.cpp:74
void AddDlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
Definition: fontsub.cpp:611
void DoSort(INT iColumn, BOOL bAscendant=TRUE)
Definition: fontsub.cpp:180
void LV_AddItems(HWND hwnd)
Definition: fontsub.cpp:233
#define _countof(array)
Definition: fontsub.cpp:30
HWND g_hListView
Definition: fontsub.cpp:49
FONTNAMESET g_Names
Definition: fontsub.cpp:70
void MainWnd_OnOpenRegKey(HWND hwnd)
Definition: fontsub.cpp:1201
BOOL EnableProcessPrivileges(LPCWSTR lpPrivilegeName, BOOL bEnable=TRUE)
Definition: fontsub.cpp:1443
WCHAR g_szSubstituteHead[MAX_STRING]
Definition: fontsub.cpp:59
void MainWnd_OnEdit(HWND hwnd)
Definition: fontsub.cpp:1191
STRING Unquote(const STRING &str)
Definition: fontsub.cpp:898
void MainWnd_OnExport(HWND hwnd)
Definition: fontsub.cpp:1155
bool ItemCompareByNameDescend(const ITEM &Item1, const ITEM &Item2)
Definition: fontsub.cpp:165
void MainWnd_OnDrawItem(HWND hwnd, const DRAWITEMSTRUCT *lpDrawItem)
Definition: fontsub.cpp:1303
BOOL g_bModified
Definition: fontsub.cpp:50
void MainWnd_OnReload(HWND hwnd)
Definition: fontsub.cpp:1186
LPCWSTR g_pszClassName
Definition: fontsub.cpp:54
HWND g_hMainWnd
Definition: fontsub.cpp:47
void LV_InvalidateRow(HWND hwnd, INT iRow=-1)
Definition: fontsub.cpp:315
void MainWnd_OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
Definition: fontsub.cpp:1435
void MakeFilter(LPWSTR pszFilter)
Definition: fontsub.cpp:1112
bool ItemCompareBySubAscend(const ITEM &Item1, const ITEM &Item2)
Definition: fontsub.cpp:170
void UnescapeChar(const STRING &str, size_t &i, STRING &Ret)
Definition: fontsub.cpp:862
INT_PTR CALLBACK AddDlg_DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: fontsub.cpp:696
BOOL AddDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
Definition: fontsub.cpp:554
BOOL DoLoadItems(void)
Definition: fontsub.cpp:256
WCHAR g_szNameHead[MAX_STRING]
Definition: fontsub.cpp:58
#define NAME_COLUMN_WIDTH
Definition: fontsub.cpp:25
BOOL DoLoad(void)
Definition: fontsub.cpp:310
void UnescapeHex(const STRING &str, size_t &i, STRING &Ret, BOOL Unicode)
Definition: fontsub.cpp:795
void MainWnd_OnDestroy(HWND hwnd)
Definition: fontsub.cpp:1293
ITEMVECTOR g_Items
Definition: fontsub.cpp:71
static void trim(STRING &str)
Definition: fontsub.cpp:107
static int CALLBACK EnumFontFamExProc(const ENUMLOGFONTW *pelf, const NEWTEXTMETRICW *pntm, int FontType, LPARAM lParam)
Definition: fontsub.cpp:123
void MainWnd_OnDelete(HWND hwnd)
Definition: fontsub.cpp:1196
bool ItemCompareByNameAscend(const ITEM &Item1, const ITEM &Item2)
Definition: fontsub.cpp:160
#define MAX_STRING
Definition: fontsub.cpp:27
BOOL DoLoadNames(void)
Definition: fontsub.cpp:145
void MainWnd_OnClose(HWND hwnd)
Definition: fontsub.cpp:1470
HINSTANCE g_hInstance
Definition: fontsub.cpp:46
BOOL DoImport(HWND hwnd, LPCWSTR pszFile)
Definition: fontsub.cpp:997
void MainWnd_OnAbout(HWND hwnd)
Definition: fontsub.cpp:1238
INT_PTR CALLBACK EditDlg_DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: fontsub.cpp:505
void MainWnd_OnSize(HWND hwnd, UINT state, int cx, int cy)
Definition: fontsub.cpp:1298
bool ItemCompareBySubDescend(const ITEM &Item1, const ITEM &Item2)
Definition: fontsub.cpp:175
LPCWSTR g_pszFileHeader
Definition: fontsub.cpp:55
LPCWSTR g_pszKey
Definition: fontsub.cpp:64
LRESULT MainWnd_OnNotify(HWND hwnd, int idFrom, NMHDR *pnmhdr)
Definition: fontsub.cpp:1384
WCHAR g_szTitle[MAX_STRING]
Definition: fontsub.cpp:57
INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nCmdShow)
Definition: fontsub.cpp:1538
BOOL g_bNeedsReboot
Definition: fontsub.cpp:51
void EditDlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
Definition: fontsub.cpp:461
void MainWnd_OnMeasureItem(HWND hwnd, MEASUREITEMSTRUCT *lpMeasureItem)
Definition: fontsub.cpp:1371
BOOL g_bSortAscendant
Definition: fontsub.cpp:62
BOOL MainWnd_OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
Definition: fontsub.cpp:531
HICON g_hIcon
Definition: fontsub.cpp:48
const WCHAR g_LongestName[]
Definition: fontsub.cpp:105
void MainWnd_OnNew(HWND hwnd)
Definition: fontsub.cpp:706
BOOL LV_Init(HWND hwnd)
Definition: fontsub.cpp:328
void UnescapeOther(const STRING &str, size_t &i, STRING &Ret)
Definition: fontsub.cpp:829
void MainWnd_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
Definition: fontsub.cpp:1256
BOOL MainWnd_OnUpdateRegistry(HWND hwnd)
Definition: fontsub.cpp:727
std::set< STRING > FONTNAMESET
Definition: fontsub.cpp:67
BOOL EditDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
Definition: fontsub.cpp:380
LRESULT MainWnd_OnContextMenu(HWND hwnd, HWND hwndContext, UINT xPos, UINT yPos)
Definition: fontsub.cpp:1414
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: fontsub.cpp:1519
BOOL DoParseFile(LPVOID pvContents, DWORD dwSize)
Definition: fontsub.cpp:915
STRING g_strFontName
Definition: fontsub.cpp:72
LPWSTR SkipSpace(LPCWSTR pch)
Definition: fontsub.cpp:767
void LV_OnDblClk(HWND hwnd)
Definition: fontsub.cpp:515
std::vector< ITEM > ITEMVECTOR
Definition: fontsub.cpp:68
FxAutoRegKey hKey
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define iswxdigit(_c)
Definition: ctype.h:668
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define REG_SZ
Definition: layer.c:22
#define pch(ap)
Definition: match.c:418
#define CREATE_ALWAYS
Definition: disk.h:72
#define FILE_FLAG_SEQUENTIAL_SCAN
Definition: disk.h:43
#define FILE_FLAG_WRITE_THROUGH
Definition: disk.h:47
#define IDS_IMPORT
Definition: resource.h:28
#define IDS_CANTOPENKEY
Definition: resource.h:38
#define IDD_EDIT
Definition: resource.h:22
#define IDS_INPFILTER
Definition: resource.h:32
#define ID_RELOAD
Definition: resource.h:17
#define IDS_CANTIMPORT
Definition: resource.h:30
#define ID_NEW
Definition: resource.h:10
#define IDS_CANTEXPORT
Definition: resource.h:31
#define IDS_ALREADYEXISTS
Definition: resource.h:35
#define IDS_EXPORT
Definition: resource.h:29
#define IDS_OUTFILTER
Definition: resource.h:33
#define IDS_SUBSTITUTE
Definition: resource.h:26
#define IDS_ENTERNAME
Definition: resource.h:27
#define IDS_REBOOTNOW
Definition: resource.h:39
#define IDS_QUERYUPDATE
Definition: resource.h:34
#define IDS_QUERYDELETE
Definition: resource.h:37
#define ID_OPEN_REGKEY
Definition: resource.h:19
#define ID_IMPORT
Definition: resource.h:15
#define IDS_ENTERNAME2
Definition: resource.h:36
#define ID_UPDATE_REGISTRY
Definition: resource.h:13
HACCEL hAccel
Definition: main.c:47
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
int Count
Definition: noreturn.cpp:7
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_READ
Definition: nt_native.h:1023
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define KEY_WRITE
Definition: nt_native.h:1031
#define GENERIC_WRITE
Definition: nt_native.h:90
#define UNICODE_NULL
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
static const WCHAR szName[]
Definition: powrprof.c:45
#define LVSIL_SMALL
Definition: commctrl.h:2299
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2673
#define ListView_GetItemRect(hwnd, i, prc, code)
Definition: commctrl.h:2478
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define LVN_COLUMNCLICK
Definition: commctrl.h:3139
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVS_EX_GRIDLINES
Definition: commctrl.h:2729
#define LVCF_IMAGE
Definition: commctrl.h:2590
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
#define ILC_COLOR8
Definition: commctrl.h:355
#define LVS_OWNERDRAWFIXED
Definition: commctrl.h:2283
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define LVS_REPORT
Definition: commctrl.h:2262
#define ListView_GetColumnWidth(hwnd, iCol)
Definition: commctrl.h:2642
#define LVCF_WIDTH
Definition: commctrl.h:2587
_Out_opt_ int * cx
Definition: commctrl.h:585
#define CBEIF_TEXT
Definition: commctrl.h:3786
#define ODT_LISTVIEW
Definition: commctrl.h:80
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2434
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
#define NM_LISTVIEW
Definition: commctrl.h:3030
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2725
#define LVIS_SELECTED
Definition: commctrl.h:2319
#define LV_COLUMNW
Definition: commctrl.h:2546
#define CBEM_INSERTITEM
Definition: commctrl.h:3845
#define LVIF_PARAM
Definition: commctrl.h:2311
#define WC_LISTVIEW
Definition: commctrl.h:2259
#define LV_ITEM
Definition: commctrl.h:2337
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2414
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ILC_MASK
Definition: commctrl.h:351
#define ListView_DeleteItem(hwnd, i)
Definition: commctrl.h:2411
#define LVN_KEYDOWN
Definition: commctrl.h:3184
#define LV_KEYDOWN
Definition: commctrl.h:3186
#define ListView_SetColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2629
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVIS_FOCUSED
Definition: commctrl.h:2318
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2519
#define LVIR_BOUNDS
Definition: commctrl.h:2472
#define LV_COLUMN
Definition: commctrl.h:2547
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
const WCHAR * str
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2379
OPENFILENAME ofn
Definition: sndrec32.cpp:56
Definition: fontsub.cpp:78
LPCWSTR DisplayName
Definition: fontsub.cpp:80
BYTE CharSet
Definition: fontsub.cpp:79
Definition: fontsub.cpp:36
BYTE m_CharSet2
Definition: fontsub.cpp:38
STRING m_Substitute
Definition: fontsub.cpp:37
ITEM(const STRING &Name, const STRING &Substitute, BYTE CharSet1, BYTE CharSet2)
Definition: fontsub.cpp:39
STRING m_Name
Definition: fontsub.cpp:37
BYTE m_CharSet1
Definition: fontsub.cpp:38
BYTE lfCharSet
Definition: dimm.idl:67
LONG cx
Definition: kdterminal.h:27
$ULONG PrivilegeCount
Definition: setypes.h:1023
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1024
LPCWSTR lpszClassName
Definition: winuser.h:3185
LPCWSTR lpszMenuName
Definition: winuser.h:3184
HBRUSH hbrBackground
Definition: winuser.h:3183
HICON hIcon
Definition: winuser.h:3181
HINSTANCE hInstance
Definition: winuser.h:3180
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
HCURSOR hCursor
Definition: winuser.h:3182
Definition: copy.c:22
LOGFONTW elfLogFont
Definition: wingdi.h:2691
WCHAR elfFullName[LF_FULLFACESIZE]
Definition: wingdi.h:2692
WCHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1910
UINT code
Definition: winuser.h:3159
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND hwndOwner
Definition: commdlg.h:330
LPCSTR lpstrTitle
Definition: commdlg.h:341
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
LONG right
Definition: windef.h:308
LONG left
Definition: windef.h:306
Definition: time.h:68
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
Definition: pdh_main.c:94
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define ZeroMemory
Definition: winbase.h:1712
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ BOOL bEnable
Definition: winddi.h:3426
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define ComboBox_GetCount(hwndCtl)
Definition: windowsx.h:48
#define HANDLE_MSG(hwnd, message, fn)
Definition: windowsx.h:322
#define HANGUL_CHARSET
Definition: wingdi.h:388
#define RUSSIAN_CHARSET
Definition: wingdi.h:396
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
FARPROC FONTENUMPROCW
Definition: wingdi.h:2897
#define ARABIC_CHARSET
Definition: wingdi.h:394
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define THAI_CHARSET
Definition: wingdi.h:397
#define TRANSPARENT
Definition: wingdi.h:950
#define GREEK_CHARSET
Definition: wingdi.h:391
#define JOHAB_CHARSET
Definition: wingdi.h:401
#define CHINESEBIG5_CHARSET
Definition: wingdi.h:390
#define ANSI_CHARSET
Definition: wingdi.h:383
#define OEM_CHARSET
Definition: wingdi.h:400
#define VIETNAMESE_CHARSET
Definition: wingdi.h:402
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
BOOL WINAPI DeleteDC(_In_ HDC)
#define MAC_CHARSET
Definition: wingdi.h:403
#define GetTextMetrics
Definition: wingdi.h:4474
#define HEBREW_CHARSET
Definition: wingdi.h:393
#define SHIFTJIS_CHARSET
Definition: wingdi.h:386
#define SYMBOL_CHARSET
Definition: wingdi.h:385
#define EASTEUROPE_CHARSET
Definition: wingdi.h:399
#define GB2312_CHARSET
Definition: wingdi.h:389
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
#define BALTIC_CHARSET
Definition: wingdi.h:395
#define TURKISH_CHARSET
Definition: wingdi.h:392
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:384
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define SW_SHOWNORMAL
Definition: winuser.h:770
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowEx
Definition: winuser.h:5755
DWORD WINAPI GetSysColor(_In_ int)
#define ODS_SELECTED
Definition: winuser.h:2545
#define WM_CLOSE
Definition: winuser.h:1621
#define DT_NOPREFIX
Definition: winuser.h:537
#define IMAGE_BITMAP
Definition: winuser.h:211
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MAKELPARAM(l, h)
Definition: winuser.h:4008
#define COLOR_WINDOW
Definition: winuser.h:918
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define IDCANCEL
Definition: winuser.h:831
#define DT_END_ELLIPSIS
Definition: winuser.h:529
#define COLOR_WINDOWTEXT
Definition: winuser.h:921
#define TPM_RIGHTBUTTON
Definition: winuser.h:2380
#define WM_CREATE
Definition: winuser.h:1608
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define CB_SETHORIZONTALEXTENT
Definition: winuser.h:1965
#define SM_CXVSCROLL
Definition: winuser.h:961
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1611
#define COLOR_HIGHLIGHT
Definition: winuser.h:926
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define LR_CREATEDIBSECTION
Definition: winuser.h:1098
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_COMMAND
Definition: winuser.h:1740
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define CB_ERR
Definition: winuser.h:2435
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define IDC_ARROW
Definition: winuser.h:687
#define CB_SETCURSEL
Definition: winuser.h:1961
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WA_INACTIVE
Definition: winuser.h:2622
#define WM_INITDIALOG
Definition: winuser.h:1739
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define MB_YESNO
Definition: winuser.h:817
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
#define WM_DRAWITEM
Definition: winuser.h:1645
#define WM_ACTIVATE
Definition: winuser.h:1612
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_ICONERROR
Definition: winuser.h:787
#define GetMessage
Definition: winuser.h:5790
#define DT_LEFT
Definition: winuser.h:534
#define EWX_REBOOT
Definition: winuser.h:638
#define VK_RETURN
Definition: winuser.h:2201
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define TPM_LEFTALIGN
Definition: winuser.h:2377
#define IDNO
Definition: winuser.h:836
#define LoadIcon
Definition: winuser.h:5813
BOOL WINAPI UpdateWindow(_In_ HWND)
#define WM_NULL
Definition: winuser.h:1607
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define LoadCursor
Definition: winuser.h:5812
#define EWX_FORCE
Definition: winuser.h:635
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:927
#define SM_CXSIZEFRAME
Definition: winuser.h:993
HDC WINAPI GetDC(_In_opt_ HWND)
#define LoadMenu
Definition: winuser.h:5817
#define MB_OK
Definition: winuser.h:790
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
#define WM_MEASUREITEM
Definition: winuser.h:1646
#define CB_SETEDITSEL
Definition: winuser.h:1963
#define DT_VCENTER
Definition: winuser.h:543
#define PostMessage
Definition: winuser.h:5832
#define CW_USEDEFAULT
Definition: winuser.h:225
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define LoadImage
Definition: winuser.h:5815
#define MB_USERICON
Definition: winuser.h:783
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define MB_ICONINFORMATION
Definition: winuser.h:802
int WINAPI MessageBoxIndirectW(_In_ CONST MSGBOXPARAMSW *lpmbp)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define VK_DELETE
Definition: winuser.h:2233
#define WM_DESTROY
Definition: winuser.h:1609
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define DispatchMessage
Definition: winuser.h:5765
int WINAPI GetScrollPos(_In_ HWND, _In_ int)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:835
#define CB_GETCURSEL
Definition: winuser.h:1943
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define LR_LOADMAP3DCOLORS
Definition: winuser.h:1097
#define TranslateAccelerator
Definition: winuser.h:5860
BOOL WINAPI DestroyWindow(_In_ HWND)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define MB_YESNOCANCEL
Definition: winuser.h:818
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SB_HORZ
Definition: winuser.h:552
#define DialogBox
Definition: winuser.h:5761
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define COLOR_3DFACE
Definition: winuser.h:929
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define TOKEN_QUERY
Definition: setypes.h:928
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193