ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/VTBFileUtil2/VTBFileUtil2.h
Revision: 262
Committed: 2003-08-16T16:09:14-07:00 (21 years, 10 months ago) by douglas
Content type: text/x-c
File size: 1232 byte(s)
Log Message:
Moof!

File Contents

# User Rev Content
1 douglas 255 // Vance Thrift and Biller File Utility 2
2     //
3     // Douglas Thrift
4     //
5 douglas 262 // $Id: VTBFileUtil2.h,v 1.5 2003/08/16 23:09:14 douglas Exp $
6 douglas 255
7     #ifndef _VTBFileUtil_h_
8     #define _VTBFileUtil_h_
9    
10     #ifdef _DEBUG
11     #pragma warning(disable:4786)
12     #endif // _DEBUG
13    
14     #include <iostream>
15     #include <string>
16     #include <sstream>
17     #include <cctype>
18     #include <vector>
19 douglas 259 #include <cstdlib>
20 douglas 255
21     #include <windows.h>
22 douglas 257 #include <commctrl.h>
23 douglas 255
24 douglas 262 #include "resource.h"
25    
26 douglas 255 using namespace std;
27    
28 douglas 262 enum Mode { none, disc, scan };
29     struct Gui
30     {
31     HINSTANCE instance;
32     HICON icon;
33     UINT_PTR tips;
34     };
35    
36 douglas 255 extern bool debug;
37     extern string program;
38     extern string programName;
39 douglas 256 extern string programVersion;
40 douglas 262 extern Gui gui;
41 douglas 255
42 douglas 259 void usage(HWND parent = NULL);
43     void version(HWND parent = NULL);
44 douglas 256 inline void center(HWND window)
45     {
46     RECT rect, dialog, desktop;
47 douglas 255
48 douglas 256 GetWindowRect(GetDesktopWindow(), &desktop);
49     GetWindowRect(window, &dialog);
50     CopyRect(&rect, &desktop);
51    
52     OffsetRect(&dialog, -dialog.left, -dialog.top);
53     OffsetRect(&rect, -rect.left, -rect.top);
54     OffsetRect(&rect, -dialog.right, -dialog.bottom);
55    
56     SetWindowPos(window, HWND_TOP, desktop.left + (rect.right / 2), desktop.top
57     + (rect.bottom / 2), 0, 0, SWP_NOSIZE);
58     }
59 douglas 259 void tooltip(HWND tool, const string& tip);
60 douglas 256
61 douglas 255 #endif // _VTBFileUtil_h_