Changeset 535 for branches/eraser6/Installer/Bootstrapper/Main.cpp
- Timestamp:
- 11/13/2008 9:56:14 AM (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Installer/Bootstrapper/Main.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Installer/Bootstrapper/Main.cpp
r533 r535 38 38 HINSTANCE hInstance = NULL; 39 39 HWND hWndParent = NULL; 40 HWND hWndStatusLbl = NULL; 41 HWND hWndProgressBar = NULL; 42 HWND hWndCancelBtn = NULL; 40 43 41 44 bool InitInstance(HINSTANCE hInstance, HWND& hWnd); … … 60 63 ~TempDir() 61 64 { 65 //TODO: remove files in the directory. 62 66 RemoveDirectoryW(DirName.c_str()); 63 67 } … … 111 115 if ( !::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0) ) 112 116 { 113 #if WINVER >= 0x0600117 #if WINVER >= 0x0600 114 118 // a new field has been added to NONCLIENTMETRICS under Vista, so 115 119 // the call to SystemParametersInfo() fails if we use the struct … … 118 122 ncm.cbSize -= sizeof(int); 119 123 if ( !::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0) ) 120 #endif124 #endif 121 125 return; 122 126 } … … 181 185 HWND hWndPanel = CreateWindowExW(0, STATIC_CLASS, NULL, WS_CHILD | WS_VISIBLE, 182 186 0, 0, 294, 104, hWndParent, NULL, hInstance, NULL); 183 HWNDhWndStatusLbl = CreateWindowExW(0, STATIC_CLASS, L"Extracting setup files...",187 hWndStatusLbl = CreateWindowExW(0, STATIC_CLASS, L"Extracting setup files...", 184 188 WS_CHILD | WS_VISIBLE, 13, 38, 270, 19, hWndPanel, NULL, hInstance, NULL); 185 HWND hWndProgressBar = CreateWindowExW(0, PROGRESS_CLASS, NULL, 186 WS_CHILD | WS_VISIBLE, 13, 13, 270, 24, hWndPanel, NULL, hInstance, NULL); 187 HWND hWndCancelBtn = CreateWindowExW(0, BUTTON_CLASS, L"Cancel", WS_TABSTOP | 189 hWndProgressBar = CreateWindowExW(0, PROGRESS_CLASS, NULL, 190 WS_CHILD | WS_VISIBLE | PBS_SMOOTH, 13, 13, 270, 24, hWndPanel, NULL, 191 hInstance, NULL); 192 hWndCancelBtn = CreateWindowExW(0, BUTTON_CLASS, L"Cancel", WS_TABSTOP | 188 193 WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 193, 65, 90, 23, hWndPanel, NULL, 189 194 hInstance, NULL); … … 195 200 SetWindowFont(hWndProgressBar); 196 201 SetWindowFont(hWndCancelBtn); 202 SendMessage(hWndProgressBar, PBM_SETRANGE, 0, MAKELPARAM(0, 1000)); 197 203 198 204 ShowWindow(hWndParent, nCmdShow); … … 228 234 } 229 235 236 void SetProgress(float progress) 237 { 238 SetWindowLong(hWndProgressBar, GWL_STYLE, 239 GetWindowLong(hWndProgressBar, GWL_STYLE) & (~PBS_MARQUEE)); 240 SendMessage(hWndProgressBar, PBM_SETPOS, (int)(progress * 1000), 0); 241 } 242 243 void SetProgressIndeterminate() 244 { 245 SetWindowLong(hWndProgressBar, GWL_STYLE, 246 GetWindowLong(hWndProgressBar, GWL_STYLE) | PBS_MARQUEE); 247 SendMessage(hWndProgressBar, PBM_SETMARQUEE, true, 100); 248 } 249 250 void SetMessage(std::wstring message) 251 { 252 } 253 230 254 void Yield() 231 255 {
Note: See TracChangeset
for help on using the changeset viewer.
