OSDN Git Service

Merge with stable
[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 // ID line follows -- this is updated by SVN
11 // $Id: StdAfx.h 6457 2009-02-15 14:08:50Z kimmov $
12
13 #if !defined(AFX_STDAFX_H__BBCD4F8A_34E4_11D1_BAA6_00A024706EDC__INCLUDED_)
14 #define AFX_STDAFX_H__BBCD4F8A_34E4_11D1_BAA6_00A024706EDC__INCLUDED_
15
16 #if _MSC_VER >= 1500
17 #if defined _M_IX86
18 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
19 #elif defined _M_IA64
20 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
21 #elif defined _M_X64
22 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
23 #else
24 #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
25 #endif
26 #endif
27
28 // Set WINVER for VC6, VS2005 and VS2008
29 //On VS2003 default is set to 0x0501 (Windows XP and Windows .NET Server)
30 //On VS2005 default is set to 0x0502 (Windows Server 2003)
31 //On VS2008 default is set to 0x0600 (Windows VISTA)
32 //
33 // Set WINVER below or in project properties (for preprocessor)
34
35 #if _MSC_VER < 1300
36 #       define WINVER 0x0400
37 #elif _MSC_VER == 1400
38         // VS2005 is too noisy when _MSC_VER is not set
39 #       if !defined(WINVER)
40 #               define WINVER 0x0501
41 #       endif
42 #elif _MSC_VER >= 1500
43         // On Win XP, with VS2008, do not use default WINVER 0x0600 because of 
44         // some windows structure used in API (on VISTA they are longer)
45 #       if !defined(WINVER)
46 #               define WINVER 0x0501
47 #       endif /* !defined(WINVER) */
48 #endif /* _MSC_VER = 1500 */
49
50 #define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers
51
52 // Disable VC6's "identifier was truncated..." warning. It is meaningless.
53 #if _MSC_VER == 1200
54         #pragma warning(disable: 4786)
55 #endif
56  
57 // Common MFC headers
58
59 #include <afxwin.h>         // MFC core and standard components
60 #include <afxext.h>         // MFC extensions
61 #include <afxcmn.h>         // MFC support for Windows Common Controls
62
63 #include <afxtempl.h>       // MFC C++ template collection classes
64 #include <afxpriv.h>        // MFC private declarations (crystal text needs but doesn't include this)
65 #include <afxole.h>         // MFC OLE (COM) support
66
67 // For CSizingControlBar
68 #include "sizecbar.h"
69 #include "scbarg.h"
70
71 #include "coretypes.h"
72
73 #define IF_IS_TRUE_ALL(expression, index, count) \
74         for (index = 0; index < count; index++) { if ((expression)) ; else break; } \
75         if (index == count)
76
77
78 /**
79  * @name User-defined Windows-messages
80  */
81 /* @{ */
82 /// Directory compare thread asks UI (view) update
83 const UINT MSG_UI_UPDATE = WM_USER + 1;
84 /// Request to save panesizes
85 const UINT MSG_STORE_PANESIZES = WM_USER + 2;
86 /* @} */
87
88 /// Seconds ignored in filetime differences if option enabled
89 static const UINT SmallTimeDiff = 2;
90
91 #include "UnicodeString.h"
92 #include "MergeApp.h"
93
94         /** @brief Wrapper around CMergeApp::TranslateDialog() */
95 void NTAPI LangTranslateDialog(HWND);
96
97         /** @brief Lang aware version of AfxMessageBox() */
98 int NTAPI LangMessageBox(UINT, UINT nType = MB_OK, UINT nIDHelp = (UINT)-1);
99
100         /** @brief Get appropriate clipboard format for TCHAR text, ie, CF_TEXT or CF_UNICODETEXT */
101 int GetClipTcharTextFormat();
102
103         /** @brief include for the custom dialog boxes, with do not ask/display again */
104 #include "MessageBoxDialog.h"
105
106 #ifdef _MAX_PATH
107 #  undef _MAX_PATH
108 #endif
109 #define _MAX_PATH (260 * sizeof(wchar_t) / sizeof(TCHAR))
110
111 #ifdef MAX_PATH
112 #  undef MAX_PATH
113 #endif
114 #define MAX_PATH (260 * sizeof(wchar_t) / sizeof(TCHAR))
115
116 #define WMPROFILE(x) CWinMergeProfile __wmtl__(x)
117
118 class CWinMergeProfile
119 {
120 private:
121         LARGE_INTEGER li[2];
122         LARGE_INTEGER freq;
123         TCHAR funcname[256];
124 public:
125         CWinMergeProfile(LPCTSTR pFuncName) {
126                 lstrcpy(funcname, pFuncName);
127                 QueryPerformanceFrequency(&freq);
128                 QueryPerformanceCounter(&li[0]);
129         }
130         ~CWinMergeProfile() {
131                 QueryPerformanceCounter(&li[1]);
132                 TCHAR buf[256];
133                 _stprintf(buf, _T("funcname=%s t=%g\n"), funcname, (double)(li[1].QuadPart-li[0].QuadPart)/freq.QuadPart);
134                 OutputDebugString(buf);
135         }
136 };
137
138 //{{AFX_INSERT_LOCATION}}
139 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
140
141 #endif // !defined(AFX_STDAFX_H__BBCD4F8A_34E4_11D1_BAA6_00A024706EDC__INCLUDED_)