diff --git a/src/StepMania-net2010.vcxproj b/src/StepMania-net2010.vcxproj index c1aef5d7d2..9f314df1dc 100644 --- a/src/StepMania-net2010.vcxproj +++ b/src/StepMania-net2010.vcxproj @@ -149,7 +149,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) ../Program/StepMania-debug.exe true ..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories) @@ -216,7 +216,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) ../Program/StepMania.exe true ..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories) @@ -280,7 +280,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;avcodec.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swscale.lib;%(AdditionalDependencies) ../Program/StepMania-fastdebug.exe true ..\extern\libpng\lib;ffmpeg\modern_working\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\;%(AdditionalLibraryDirectories) @@ -349,7 +349,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) /MACHINE:I386 "$(IntDir)verstub.obj" %(AdditionalOptions) - shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) + shell32.lib;gdi32.lib;user32.lib;ole32.lib;advapi32.lib;Comctl32.lib;ffmpeg/modern_working/lib/avcodec.lib;ffmpeg/modern_working/lib/avformat.lib;ffmpeg/modern_working/lib/avutil.lib;ffmpeg/modern_working/lib/swscale.lib;%(AdditionalDependencies) ..\Program/StepMania-SSE2.exe true ..\extern\libpng\lib;ffmpeg\lib;..\extern\libjpeg\;..\extern\zlib\;..\extern\mad-0.15.1b\msvc++\Release\%(AdditionalLibraryDirectories) @@ -2395,4 +2395,4 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) - + \ No newline at end of file diff --git a/src/arch/LoadingWindow/LoadingWindow.h b/src/arch/LoadingWindow/LoadingWindow.h index 888a265e39..1ddfa7e110 100644 --- a/src/arch/LoadingWindow/LoadingWindow.h +++ b/src/arch/LoadingWindow/LoadingWindow.h @@ -14,6 +14,12 @@ public: virtual void Paint() { } virtual void SetText( RString str ) = 0; virtual void SetIcon( const RageSurface *pIcon ) { } + virtual void SetProgress( const int progress ) { m_progress=progress; } + virtual void SetTotalWork( const int totalWork ) { m_totalWork=totalWork; } + +protected: + int m_progress; + int m_totalWork; }; #endif diff --git a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index 4801e0bac7..9148e15db8 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -7,6 +7,7 @@ #include "archutils/win32/WindowIcon.h" #include "archutils/win32/ErrorStrings.h" #include +#include "CommCtrl.h" #include "RageSurface_Load.h" #include "RageSurface.h" #include "RageSurfaceUtils.h" @@ -17,6 +18,9 @@ #include "RageSurfaceUtils_Zoom.h" static HBITMAP g_hBitmap = NULL; +#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") + + /* Load a RageSurface into a GDI surface. */ static HBITMAP LoadWin32Surface( RageSurface *&s ) { @@ -118,6 +122,11 @@ void LoadingWindow_Win32::SetIcon( const RageSurface *pIcon ) LoadingWindow_Win32::LoadingWindow_Win32() { + INITCOMMONCONTROLSEX cceData; + cceData.dwSize=sizeof(INITCOMMONCONTROLSEX); + cceData.dwICC=ICC_PROGRESS_CLASS; + InitCommonControlsEx(&cceData); + m_hIcon = NULL; hwnd = CreateDialog( handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), NULL, WndProc ); for( unsigned i = 0; i < 3; ++i ) @@ -168,6 +177,20 @@ void LoadingWindow_Win32::SetText( RString sText ) } } +void LoadingWindow_Win32::SetProgress(const int progress) +{ + m_progress=progress; + HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS ); + ::SendMessage(hwndItem,PBM_SETPOS,progress,0); +} + +void LoadingWindow_Win32::SetTotalWork(const int totalWork) +{ + m_totalWork=totalWork; + HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS ); + ::SendMessage(hwndItem,PBM_SETRANGE32,0,totalWork); +} + /* * (c) 2001-2004 Chris Danford, Glenn Maynard * All rights reserved. diff --git a/src/arch/LoadingWindow/LoadingWindow_Win32.h b/src/arch/LoadingWindow/LoadingWindow_Win32.h index f490392acb..365a7ee2bc 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Win32.h +++ b/src/arch/LoadingWindow/LoadingWindow_Win32.h @@ -16,6 +16,8 @@ public: void SetText( RString sText ); void Paint(); void SetIcon( const RageSurface *pIcon ); + void SetProgress( const int progress ); + void SetTotalWork( const int totalWork ); private: AppInstance handle; diff --git a/src/archutils/Win32/WindowsResources.h b/src/archutils/Win32/WindowsResources.h index 348f2ffdb0..be6ceda5c4 100644 --- a/src/archutils/Win32/WindowsResources.h +++ b/src/archutils/Win32/WindowsResources.h @@ -29,7 +29,6 @@ #define IDC_BUTTON_CLOSE 1011 #define IDC_VIEW_LOG 1012 #define IDC_STATIC_MESSAGE3 1013 -#define IDC_PROGRESS1 1014 #define IDC_PROGRESS 1014 #define IDC_HUSH 1016 #define IDC_MESSAGE 1017 diff --git a/src/archutils/Win32/WindowsResources.rc b/src/archutils/Win32/WindowsResources.rc index ad20d9749a..494c422801 100644 --- a/src/archutils/Win32/WindowsResources.rc +++ b/src/archutils/Win32/WindowsResources.rc @@ -7,19 +7,20 @@ // // Generated from the TEXTINCLUDE 2 resource. // + +#define _WIN32_WINNT 0x0501 #include "winres.h" +#include "CommCtrl.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // @@ -43,14 +44,16 @@ BEGIN CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,0,34,332,1 END -IDD_LOADING_DIALOG DIALOG 0, 0, 312, 82 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE -FONT 8, "MS Sans Serif" +IDD_LOADING_DIALOG DIALOGEX 0, 0, 317, 94 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - CTEXT "line1",IDC_STATIC_MESSAGE1,0,41,310,10,SS_NOPREFIX | SS_CENTERIMAGE - CTEXT "line2",IDC_STATIC_MESSAGE2,0,54,310,10,SS_NOPREFIX | SS_CENTERIMAGE - CTEXT "line3",IDC_STATIC_MESSAGE3,0,65,310,10,SS_NOPREFIX | SS_CENTERIMAGE + CTEXT "line1",IDC_STATIC_MESSAGE1,0,67,310,10,SS_NOPREFIX | SS_CENTERIMAGE + CTEXT "line2",IDC_STATIC_MESSAGE2,0,76,310,10,SS_NOPREFIX | SS_CENTERIMAGE + CTEXT "line3",IDC_STATIC_MESSAGE3,0,84,310,10,SS_NOPREFIX | SS_CENTERIMAGE CONTROL "",IDC_SPLASH,"Static",SS_BITMAP,0,0,310,25 + CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_MARQUEE,7,51,298,14 END IDD_DISASM_CRASH DIALOGEX 0, 0, 332, 114 @@ -102,14 +105,14 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_LOADING_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 305 + RIGHTMARGIN, 310 TOPMARGIN, 7 - BOTTOMMARGIN, 75 + BOTTOMMARGIN, 87 END IDD_DISASM_CRASH, DIALOG @@ -212,7 +215,7 @@ BEGIN END END -#endif // English (U.S.) resources +#endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/archutils/Win32/arch_setup.h b/src/archutils/Win32/arch_setup.h index 983aa3868d..c403f26b4c 100644 --- a/src/archutils/Win32/arch_setup.h +++ b/src/archutils/Win32/arch_setup.h @@ -66,7 +66,7 @@ C4355: 'this' : used in base member initializer list /* Pull in NT-only definitions. Note that we support Win98 and WinME; you can * make NT calls, but be sure to fall back on 9x if they're not supported. */ -#define _WIN32_WINNT 0x0400 +#define _WIN32_WINNT 0x0501 #define _WIN32_IE 0x0400 // If this isn't defined to 0, VC fails to define things like stat and alloca.