OSDN Git Service

Fix untranslated strings
[winmerge-jp/winmerge-jp.git] / Src / 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  * @file  Src/StdAfx.h
7  *
8  * @brief Project-wide includes and declarations
9  */
10 #pragma once
11
12 #if defined _M_IX86
13 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
14 #elif defined _M_IA64
15 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
16 #elif defined _M_X64
17 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
18 #else
19 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
20 #endif
21
22 // On Win XP, with VS2008, do not use default WINVER 0x0600 because of 
23 // some windows structure used in API (on VISTA they are longer)
24 #if !defined(WINVER)
25 #  define WINVER 0x0501
26 #endif /* !defined(WINVER) */
27
28 #define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers
29
30 // Common MFC headers
31
32 #include <afxwin.h>         // MFC core and standard components
33 #include <afxext.h>         // MFC extensions
34 #include <afxcmn.h>         // MFC support for Windows Common Controls
35
36 #include <afxtempl.h>       // MFC C++ template collection classes
37 #include <afxpriv.h>        // MFC private declarations (crystal text needs but doesn't include this)
38 #include <afxole.h>         // MFC OLE (COM) support
39
40 // For CSizingControlBar
41 #include "sizecbar.h"
42 #include "scbarg.h"
43
44 #include "coretypes.h"
45
46 #define IF_IS_TRUE_ALL(expression, index, count) \
47         for (index = 0; index < count; index++) { if ((expression)) ; else break; } \
48         if (index == count)
49
50
51 /**
52  * @name User-defined Windows-messages
53  */
54 /* @{ */
55 /// Directory compare thread asks UI (view) update
56 const UINT MSG_UI_UPDATE = WM_USER + 1;
57 /// Request to save panesizes
58 const UINT MSG_STORE_PANESIZES = WM_USER + 2;
59 /* @} */
60
61 /// Seconds ignored in filetime differences if option enabled
62 static const UINT SmallTimeDiff = 2;
63
64 #include "UnicodeString.h"
65 #include "MergeApp.h"
66
67         /** @brief Wrapper around CMergeApp::TranslateDialog() */
68 void NTAPI LangTranslateDialog(HWND);
69
70         /** @brief Lang aware version of AfxMessageBox() */
71 int NTAPI LangMessageBox(UINT, UINT nType = MB_OK, UINT nIDHelp = (UINT)-1);
72
73         /** @brief include for the custom dialog boxes, with do not ask/display again */
74 #include "MessageBoxDialog.h"
75
76 #ifdef _MAX_PATH
77 #  undef _MAX_PATH
78 #endif
79 #define _MAX_PATH (260 * sizeof(wchar_t) / sizeof(TCHAR))
80
81 #ifdef MAX_PATH
82 #  undef MAX_PATH
83 #endif
84 #define MAX_PATH (260 * sizeof(wchar_t) / sizeof(TCHAR))
85
86 #define WMPROFILE(x) CWinMergeProfile __wmtl__(x)
87
88 class CWinMergeProfile
89 {
90 private:
91         LARGE_INTEGER li[2];
92         LARGE_INTEGER freq;
93         TCHAR funcname[256];
94 public:
95         explicit CWinMergeProfile(LPCTSTR pFuncName) {
96                 lstrcpy(funcname, pFuncName);
97                 QueryPerformanceFrequency(&freq);
98                 QueryPerformanceCounter(&li[0]);
99         }
100         ~CWinMergeProfile() {
101                 QueryPerformanceCounter(&li[1]);
102                 TCHAR buf[256];
103                 wsprintf(buf, _T("funcname=%s t=%d[us]\n"), funcname, (int)((double)(li[1].QuadPart-li[0].QuadPart)/freq.QuadPart*1000.0*1000.0));
104                 OutputDebugString(buf);
105         }
106 };
107
108 //{{AFX_INSERT_LOCATION}}
109 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.