2 |
|
// |
3 |
|
// Douglas Thrift |
4 |
|
// |
5 |
< |
// $Id: VTBFileUtil2.h,v 1.4 2003/08/16 08:40:55 douglas Exp $ |
5 |
> |
// $Id: VTBFileUtil2.h,v 1.7 2003/08/17 03:55:39 douglas Exp $ |
6 |
|
|
7 |
|
#ifndef _VTBFileUtil_h_ |
8 |
|
#define _VTBFileUtil_h_ |
16 |
|
#include <sstream> |
17 |
|
#include <cctype> |
18 |
|
#include <vector> |
19 |
+ |
#include <set> |
20 |
+ |
#include <map> |
21 |
|
#include <cstdlib> |
22 |
|
|
23 |
|
#include <windows.h> |
24 |
|
#include <commctrl.h> |
25 |
+ |
#include <objbase.h> |
26 |
+ |
#include <shlobj.h> |
27 |
+ |
|
28 |
+ |
#include "resource.h" |
29 |
|
|
30 |
|
using namespace std; |
31 |
|
|
32 |
+ |
enum Mode { none, disc, scan }; |
33 |
+ |
struct Gui |
34 |
+ |
{ |
35 |
+ |
HINSTANCE instance; |
36 |
+ |
HICON icon; |
37 |
+ |
UINT_PTR tips; |
38 |
+ |
}; |
39 |
+ |
|
40 |
|
extern bool debug; |
41 |
|
extern string program; |
42 |
|
extern string programName; |
43 |
|
extern string programVersion; |
44 |
< |
|
31 |
< |
enum Mode { none, disc, scan }; |
44 |
> |
extern Gui gui; |
45 |
|
|
46 |
|
void usage(HWND parent = NULL); |
47 |
|
void version(HWND parent = NULL); |
48 |
< |
void choice(Mode& mode, HWND parent = NULL); |
48 |
> |
inline string toAnsi(const wstring& wide) |
49 |
> |
{ |
50 |
> |
LPSTR buffer = new CHAR[wide.length() + 1]; |
51 |
> |
|
52 |
> |
WideCharToMultiByte(CP_ACP, 0, wide.c_str(), wide.length() + 1, buffer, |
53 |
> |
wide.length() + 1, NULL, NULL); |
54 |
> |
|
55 |
> |
return buffer; |
56 |
> |
} |
57 |
> |
inline wstring toWide(const string& ansi) |
58 |
> |
{ |
59 |
> |
LPWSTR buffer = new WCHAR[ansi.length() + 1]; |
60 |
> |
|
61 |
> |
MultiByteToWideChar(CP_ACP, 0, ansi.c_str(), ansi.length() + 1, buffer, |
62 |
> |
ansi.length() + 1); |
63 |
> |
|
64 |
> |
return buffer; |
65 |
> |
} |
66 |
|
inline void center(HWND window) |
67 |
|
{ |
68 |
|
RECT rect, dialog, desktop; |