ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/VTBFileUtil2/VTBFileUtil2.h
Revision: 256
Committed: 2003-08-15T21:56:17-07:00 (21 years, 10 months ago) by douglas
Content type: text/x-c
Original Path: trunk/VTBFileUtil2/VTBFileUtil2.h
File size: 1049 byte(s)
Log Message:
Did stuff.

File Contents

# User Rev Content
1 douglas 255 // Vance Thrift and Biller File Utility 2
2     //
3     // Douglas Thrift
4     //
5 douglas 256 // $Id: VTBFileUtil2.h,v 1.2 2003/08/16 04:56:17 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    
20     #include <windows.h>
21    
22     using namespace std;
23    
24     extern bool debug;
25     extern string program;
26     extern string programName;
27 douglas 256 extern string programVersion;
28 douglas 255
29 douglas 256 void usage(HINSTANCE instance, HWND parent = NULL);
30     void version(HINSTANCE instance, HWND parent = NULL);
31     inline void center(HWND window)
32     {
33     RECT rect, dialog, desktop;
34 douglas 255
35 douglas 256 GetWindowRect(GetDesktopWindow(), &desktop);
36     GetWindowRect(window, &dialog);
37     CopyRect(&rect, &desktop);
38    
39     OffsetRect(&dialog, -dialog.left, -dialog.top);
40     OffsetRect(&rect, -rect.left, -rect.top);
41     OffsetRect(&rect, -dialog.right, -dialog.bottom);
42    
43     SetWindowPos(window, HWND_TOP, desktop.left + (rect.right / 2), desktop.top
44     + (rect.bottom / 2), 0, 0, SWP_NOSIZE);
45     }
46    
47 douglas 255 #endif // _VTBFileUtil_h_