X-Git-Url: https://git.blender.org/gitweb/gitweb.cgi/blender.git/blobdiff_plain/75f155be33dcae185e995e7baa6c18b680233fdc..a70e69738191675d8630974b3eef93a2b7236323:/intern/ghost/intern/GHOST_WindowWin32.cpp diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 36f5c5d1fba..11c6ab01287 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -139,6 +139,26 @@ GHOST_WindowWin32::GHOST_WindowWin32( m_stereo(stereoVisual), m_nextWindow(NULL) { + OSVERSIONINFOEX versionInfo; + bool hasMinVersionForTaskbar = false; + + ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX)); + + versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + + if(!GetVersionEx((OSVERSIONINFO *)&versionInfo)) { + versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if(GetVersionEx((OSVERSIONINFO*)&versionInfo)) { + if(versionInfo.dwMajorVersion>=6 && versionInfo.dwMinorVersion>=1) { + hasMinVersionForTaskbar = true; + } + } + } else { + if(versionInfo.dwMajorVersion>=6 && versionInfo.dwMinorVersion>=1) { + hasMinVersionForTaskbar = true; + } + } + if (state != GHOST_kWindowStateFullScreen) { RECT rect; MONITORINFO monitor; @@ -308,11 +328,22 @@ GHOST_WindowWin32::GHOST_WindowWin32( } } } + + if(hasMinVersionForTaskbar) + CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList ,(LPVOID*)&m_Bar); + else + m_Bar=NULL; } GHOST_WindowWin32::~GHOST_WindowWin32() { + if(m_Bar) + { + m_Bar->SetProgressState(m_hWnd, TBPF_NOPROGRESS); + m_Bar->Release(); + }; + if (m_wintab) { GHOST_WIN32_WTClose fpWTClose = ( GHOST_WIN32_WTClose ) ::GetProcAddress( m_wintab, "WTClose" ); if (fpWTClose) { @@ -1103,6 +1134,23 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap } +GHOST_TSuccess GHOST_WindowWin32::setProgressBar(float progress) +{ + /*SetProgressValue sets state to TBPF_NORMAL automaticly*/ + if(m_Bar && S_OK == m_Bar->SetProgressValue(m_hWnd,10000*progress,10000)) + return GHOST_kSuccess; + + return GHOST_kFailure; +} + +GHOST_TSuccess GHOST_WindowWin32::endProgressBar() +{ + if(m_Bar && S_OK == m_Bar->SetProgressState(m_hWnd,TBPF_NOPROGRESS)) + return GHOST_kSuccess; + + return GHOST_kFailure; +} + /* Ron Fosner's code for weighting pixel formats and forcing software. See http://www.opengl.org/resources/faq/technical/weight.cpp */