ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/VTBFileUtil2/VTBFileUtil2.cxx
(Generate patch)

Comparing trunk/VTBFileUtil2/VTBFileUtil2.cxx (file contents):
Revision 265 by douglas, 2003-08-16T20:55:39-07:00 vs.
Revision 273 by douglas, 2003-08-20T23:29:24-07:00

# Line 2 | Line 2
2   //
3   // Douglas Thrift
4   //
5 < // $Id: VTBFileUtil2.cxx,v 1.8 2003/08/17 03:55:39 douglas Exp $
5 > // $Id: VTBFileUtil2.cxx,v 1.11 2003/08/21 06:29:24 douglas Exp $
6  
7   #include "VTBFileUtil2.h"
8   #include "Chooser.h"
# Line 86 | Line 86 | int WINAPI WinMain(HINSTANCE hInstance,
86          vector<string> args;
87          
88          InitCommonControls();
89 +        CoInitialize(NULL);
90          arguments(args, GetCommandLine());
91  
92          program = args[0];
# Line 94 | Line 95 | int WINAPI WinMain(HINSTANCE hInstance,
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          {
# Line 201 | Line 201 | int WINAPI WinMain(HINSTANCE hInstance,
201                  utility.run();
202          }
203  
204 +        CoUninitialize();
205 +
206          if (debug)
207          {
208                  cout << "Press enter key to exit . . .";
# Line 210 | Line 212 | int WINAPI WinMain(HINSTANCE hInstance,
212          return 0;
213   }
214  
213 void tooltip(HWND tool, const string& tip)
214 {
215        HWND tooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP
216                | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
217                CW_USEDEFAULT, CW_USEDEFAULT, tool, NULL, gui.instance, NULL);
218        RECT rect;
219
220        SetWindowPos(tooltip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
221                SWP_NOACTIVATE);
222
223        GetClientRect(tool, &rect);
224
225        TOOLINFO toolinfo;
226        LPTSTR ctip = new CHAR[tip.length()];
227
228        sprintf(ctip, "%s", tip.c_str());
229
230        if (debug) cerr << "ctip = " << ctip << "\n";
231
232        toolinfo.cbSize = sizeof(TOOLINFO);
233        toolinfo.uFlags = TTF_SUBCLASS;
234        toolinfo.hwnd = tool;
235        toolinfo.hinst = gui.instance;
236        toolinfo.uId = gui.tips++;
237        toolinfo.lpszText = ctip;
238        toolinfo.rect.left = rect.left;
239        toolinfo.rect.top = rect.top;
240        toolinfo.rect.right = rect.right;
241        toolinfo.rect.bottom = rect.bottom;
242
243        SendMessage(tooltip, TTM_ADDTOOL, 0, LPARAM(LPTOOLINFO(&toolinfo)));
244 }
245
215   INT_PTR CALLBACK usage(HWND dialog, UINT msg, WPARAM w, LPARAM l)
216   {
217          switch (msg)
# Line 261 | Line 230 | INT_PTR CALLBACK usage(HWND dialog, UINT
230                                  << "  -disc\t\tStart in Disc Browse mode\n"
231                                  << "  -scan\t\tStart in Scan Utility mode\n";
232  
233 <                        SendMessage(GetDlgItem(dialog, IDC_USAGE_TEXT), WM_SETTEXT, 0,
265 <                                LPARAM(usage.str().c_str()));
233 >                        SetDlgItemText(dialog, IDC_USAGE_TEXT, usage.str().c_str());
234                  }
235                  break;
236          case WM_COMMAND:
# Line 295 | Line 263 | INT_PTR CALLBACK version(HWND dialog, UI
263                          version << programName << " (" << programVersion << ")\n\n"
264                                  << "Copyright © 2003, Douglas Thrift.\n";
265  
266 <                        SendMessage(GetDlgItem(dialog, IDC_VERSION_TEXT), WM_SETTEXT, 0,
299 <                                LPARAM(version.str().c_str()));
266 >                        SetDlgItemText(dialog, IDC_VERSION_TEXT, version.str().c_str());
267                  }
268                  break;
269          case WM_COMMAND:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines