2 |
|
// |
3 |
|
// Douglas Thrift |
4 |
|
// |
5 |
< |
// $Id: VTBFileUtil2.cxx,v 1.7 2003/08/17 00:43:49 douglas Exp $ |
5 |
> |
// $Id: VTBFileUtil2.cxx,v 1.10 2003/08/19 04:39:38 douglas Exp $ |
6 |
|
|
7 |
|
#include "VTBFileUtil2.h" |
8 |
|
#include "Chooser.h" |
86 |
|
vector<string> args; |
87 |
|
|
88 |
|
InitCommonControls(); |
89 |
+ |
CoInitialize(NULL); |
90 |
|
arguments(args, GetCommandLine()); |
91 |
|
|
92 |
|
program = args[0]; |
95 |
|
|
96 |
|
gui.instance = hInstance; |
97 |
|
gui.icon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_VTB_ICON)); |
97 |
– |
gui.tips = 0; |
98 |
|
|
99 |
|
for (unsigned index = 1; index < args.size(); index++) |
100 |
|
{ |
190 |
|
|
191 |
|
if (mode == disc) |
192 |
|
{ |
193 |
< |
MessageBox(NULL, "Disc Browse mode", programName.c_str(), |
194 |
< |
MB_ICONINFORMATION); |
193 |
> |
DiscBrowse browser; |
194 |
> |
|
195 |
> |
browser.run(); |
196 |
|
} |
197 |
|
else if (mode == scan) |
198 |
|
{ |
199 |
< |
MessageBox(NULL, "Scan Utility mode", programName.c_str(), |
200 |
< |
MB_ICONINFORMATION); |
199 |
> |
ScanUtility utility; |
200 |
> |
|
201 |
> |
utility.run(); |
202 |
|
} |
203 |
|
|
204 |
+ |
CoUninitialize(); |
205 |
+ |
|
206 |
|
if (debug) |
207 |
|
{ |
208 |
|
cout << "Press enter key to exit . . ."; |
212 |
|
return 0; |
213 |
|
} |
214 |
|
|
211 |
– |
void tooltip(HWND tool, const string& tip) |
212 |
– |
{ |
213 |
– |
HWND tooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP |
214 |
– |
| TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, |
215 |
– |
CW_USEDEFAULT, CW_USEDEFAULT, tool, NULL, gui.instance, NULL); |
216 |
– |
RECT rect; |
217 |
– |
|
218 |
– |
SetWindowPos(tooltip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | |
219 |
– |
SWP_NOACTIVATE); |
220 |
– |
|
221 |
– |
GetClientRect(tool, &rect); |
222 |
– |
|
223 |
– |
TOOLINFO toolinfo; |
224 |
– |
LPTSTR ctip = new CHAR[tip.length()]; |
225 |
– |
|
226 |
– |
sprintf(ctip, "%s", tip.c_str()); |
227 |
– |
|
228 |
– |
if (debug) cerr << "ctip = " << ctip << "\n"; |
229 |
– |
|
230 |
– |
toolinfo.cbSize = sizeof(TOOLINFO); |
231 |
– |
toolinfo.uFlags = TTF_SUBCLASS; |
232 |
– |
toolinfo.hwnd = tool; |
233 |
– |
toolinfo.hinst = gui.instance; |
234 |
– |
toolinfo.uId = gui.tips++; |
235 |
– |
toolinfo.lpszText = ctip; |
236 |
– |
toolinfo.rect.left = rect.left; |
237 |
– |
toolinfo.rect.top = rect.top; |
238 |
– |
toolinfo.rect.right = rect.right; |
239 |
– |
toolinfo.rect.bottom = rect.bottom; |
240 |
– |
|
241 |
– |
SendMessage(tooltip, TTM_ADDTOOL, 0, LPARAM(LPTOOLINFO(&toolinfo))); |
242 |
– |
} |
243 |
– |
|
215 |
|
INT_PTR CALLBACK usage(HWND dialog, UINT msg, WPARAM w, LPARAM l) |
216 |
|
{ |
217 |
|
switch (msg) |