Commit dcce0350 authored by Geoffroy Couprie's avatar Geoffroy Couprie

Win32: get rid of calls to GetVersion (CoCreateInstance will fail anyway if...

Win32: get rid of calls to GetVersion (CoCreateInstance will fail anyway if the feature is not present)
parent c84c86d4
......@@ -239,10 +239,7 @@ void VideoWidget::release( void )
#ifdef WIN32
/* Come back to default thumbnail for Windows 7 taskbar */
LPTASKBARLIST3 p_taskbl;
OSVERSIONINFO winVer;
winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if( GetVersionEx(&winVer) && winVer.dwMajorVersion > 5 )
{
CoInitialize( 0 );
if( S_OK == CoCreateInstance( &clsid_ITaskbarList,
......@@ -260,7 +257,7 @@ void VideoWidget::release( void )
p_taskbl->vt->Release(p_taskbl);
}
CoUninitialize();
}
#endif
delete reparentable;
......
......@@ -859,11 +859,6 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
void SPrefsPanel::assoDialog()
{
OSVERSIONINFO winVer;
winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
//Vista specific file associations
if( GetVersionEx(&winVer) && winVer.dwMajorVersion > 5 )
{
LPAPPASSOCREGUI p_appassoc;
CoInitialize( 0 );
......@@ -880,7 +875,7 @@ void SPrefsPanel::assoDialog()
}
CoUninitialize();
}
QDialog *d = new QDialog( this );
QGridLayout *assoLayout = new QGridLayout( d );
......
......@@ -519,10 +519,16 @@ void MainInterface::createTaskBarButtons()
FIXME:We need pretty buttons in 16x16 px that are handled correctly by masks in Qt
FIXME:the play button's picture doesn't changed to pause when clicked
*/
OSVERSIONINFO winVer;
winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if( GetVersionEx(&winVer) && winVer.dwMajorVersion > 5 )
CoInitialize( 0 );
if( S_OK == CoCreateInstance( &clsid_ITaskbarList,
NULL, CLSCTX_INPROC_SERVER,
&IID_ITaskbarList3,
(void **)&p_taskbl) )
{
p_taskbl->vt->HrInit(p_taskbl);
if(himl = ImageList_Create( 15, //cx
18, //cy
ILC_COLOR,//flags
......@@ -549,15 +555,6 @@ void MainInterface::createTaskBarButtons()
msg_Err( p_intf, "ImageList_Add failed" );
}
CoInitialize( 0 );
if( S_OK == CoCreateInstance( &clsid_ITaskbarList,
NULL, CLSCTX_INPROC_SERVER,
&IID_ITaskbarList3,
(void **)&p_taskbl) )
{
p_taskbl->vt->HrInit(p_taskbl);
// Define an array of two buttons. These buttons provide images through an
// image list and also provide tooltips.
DWORD dwMask = THB_BITMAP | THB_FLAGS;
......@@ -589,12 +586,12 @@ void MainInterface::createTaskBarButtons()
}
CONNECT( THEMIM->getIM(), statusChanged( int ), this, changeThumbbarButtons( int ) );
}
}
else
{
himl = NULL;
p_taskbl = NULL;
}
}
bool MainInterface::winEvent ( MSG * msg, long * result )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment