1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - Stefan Kueng
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
20 #include "TortoiseUDiff.h"
\r
21 #include "MainWindow.h"
\r
22 #include "CmdLineParser.h"
\r
24 #include <commctrl.h>
\r
25 #pragma comment(lib, "comctl32.lib")
\r
28 #pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
\r
31 int APIENTRY _tWinMain(HINSTANCE hInstance,
\r
32 HINSTANCE hPrevInstance,
\r
36 UNREFERENCED_PARAMETER(hPrevInstance);
\r
37 UNREFERENCED_PARAMETER(nCmdShow);
\r
42 CCmdLineParser parser(lpCmdLine);
\r
44 if (parser.HasKey(_T("?")) || parser.HasKey(_T("help")) || !parser.HasKey(_T("patchfile")))
\r
47 LoadString(hInstance, IDS_COMMANDLINEHELP, buf, sizeof(buf)/sizeof(TCHAR));
\r
48 MessageBox(NULL, buf, _T("TortoiseUDiff"), MB_ICONINFORMATION);
\r
52 INITCOMMONCONTROLSEX used = {
\r
53 sizeof(INITCOMMONCONTROLSEX),
\r
54 ICC_STANDARD_CLASSES | ICC_BAR_CLASSES
\r
56 InitCommonControlsEx(&used);
\r
59 if (::LoadLibrary(_T("SciLexer.DLL")) == NULL)
\r
62 CMainWindow mainWindow(hInstance);
\r
63 if (parser.HasVal(_T("title")))
\r
64 mainWindow.SetTitle(parser.GetVal(_T("title")));
\r
66 mainWindow.SetTitle(parser.GetVal(_T("patchfile")));
\r
67 if (mainWindow.RegisterAndCreateWindow())
\r
69 if (mainWindow.LoadFile(parser.GetVal(_T("patchfile"))))
\r
71 ::ShowWindow(mainWindow.GetHWNDEdit(), SW_SHOW);
\r
72 ::SetFocus(mainWindow.GetHWNDEdit());
\r
74 hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TORTOISEUDIFF));
\r
76 // Main message loop:
\r
77 while (GetMessage(&msg, NULL, 0, 0))
\r
79 if (!TranslateAccelerator(mainWindow, hAccelTable, &msg))
\r
81 TranslateMessage(&msg);
\r
82 DispatchMessage(&msg);
\r
85 return (int) msg.wParam;
\r