1 |
douglas |
260 |
// Vance Thrift and Biller File Utility 2 |
2 |
|
|
// |
3 |
|
|
// Douglas Thrift |
4 |
|
|
// |
5 |
douglas |
268 |
// $Id: ScanUtility.cxx,v 1.3 2003/08/19 04:39:38 douglas Exp $ |
6 |
douglas |
260 |
|
7 |
|
|
#include "ScanUtility.h" |
8 |
douglas |
265 |
|
9 |
douglas |
268 |
ScanUtility::ScanUtility() |
10 |
|
|
{ |
11 |
|
|
number = count++; |
12 |
|
|
utilities.insert(pair<unsigned, ScanUtility*>(number, this)); |
13 |
|
|
title = new char[programName.length() + 16]; |
14 |
|
|
|
15 |
|
|
sprintf(title, "%s - Scan Utility", programName.c_str()); |
16 |
|
|
|
17 |
|
|
PROPSHEETPAGE page; |
18 |
|
|
|
19 |
|
|
// start |
20 |
|
|
page.dwSize = sizeof(page); |
21 |
|
|
page.dwFlags = PSP_DEFAULT | PSP_USEHICON | PSP_USETITLE | |
22 |
|
|
PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; |
23 |
|
|
page.hInstance = gui.instance; |
24 |
|
|
page.pszTemplate = MAKEINTRESOURCE(IDD_SCAN_START); |
25 |
|
|
page.hIcon = gui.icon; |
26 |
|
|
page.pszTitle = title; |
27 |
|
|
page.pfnDlgProc = start; |
28 |
|
|
page.lParam = number; |
29 |
|
|
page.pszHeaderTitle = "Start"; |
30 |
|
|
page.pszHeaderSubTitle = "Change any settings before scanning."; |
31 |
|
|
|
32 |
|
|
wizard[0] = CreatePropertySheetPage(&page); |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
ScanUtility::~ScanUtility() |
36 |
|
|
{ |
37 |
|
|
utilities.erase(number); |
38 |
|
|
delete [] title; |
39 |
|
|
} |
40 |
|
|
|
41 |
douglas |
265 |
void ScanUtility::run(void) |
42 |
|
|
{ |
43 |
douglas |
268 |
PROPSHEETHEADER header; |
44 |
douglas |
265 |
|
45 |
douglas |
268 |
// header |
46 |
|
|
header.dwSize = sizeof(header); |
47 |
|
|
header.dwFlags = PSH_DEFAULT | PSH_USEICONID | PSH_WIZARD97; |
48 |
|
|
header.hwndParent = NULL; |
49 |
|
|
header.hInstance = gui.instance; |
50 |
|
|
header.pszIcon = MAKEINTRESOURCE(IDI_VTB_ICON); |
51 |
|
|
header.nPages = 1; |
52 |
|
|
header.nStartPage = 0; |
53 |
|
|
header.phpage = wizard; |
54 |
douglas |
265 |
|
55 |
douglas |
268 |
PropertySheet(&header); |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
unsigned ScanUtility::count = 0; |
59 |
|
|
map<unsigned, ScanUtility*> ScanUtility::utilities; |
60 |
|
|
map<HWND, ScanUtility*> ScanUtility::windows; |
61 |
|
|
|
62 |
|
|
INT_PTR ScanUtility::start(HWND dialog, UINT msg, WPARAM w, LPARAM l) |
63 |
|
|
{ |
64 |
|
|
map<HWND, ScanUtility*>::iterator itor = windows.find(dialog); |
65 |
|
|
ScanUtility* data = itor->second; |
66 |
|
|
|
67 |
|
|
switch (msg) |
68 |
douglas |
265 |
{ |
69 |
douglas |
268 |
case WM_INITDIALOG: |
70 |
|
|
{ |
71 |
|
|
map<unsigned, ScanUtility*>::iterator itor = utilities.find(l); |
72 |
douglas |
265 |
|
73 |
douglas |
268 |
windows.insert(pair<HWND, ScanUtility*>(dialog, itor->second)); |
74 |
|
|
} |
75 |
|
|
break; |
76 |
|
|
} |
77 |
douglas |
265 |
|
78 |
douglas |
268 |
return FALSE; |
79 |
douglas |
265 |
} |