00001 00002 /************************************************************************* 00003 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. * 00004 * All rights reserved. * 00005 * * 00006 * For the licensing terms see $ROOTSYS/LICENSE. * 00007 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00008 *************************************************************************/ 00009 00010 #include "Windows4Root.h" 00011 #include "TWin32SplashThread.h" 00012 00013 TWin32SplashThread *gSplash = 0; 00014 00015 extern void CreateSplash(DWORD time, BOOL extended); 00016 extern void DestroySplashScreen(); 00017 00018 //______________________________________________________________________________ 00019 static DWORD WINAPI HandleSplashThread(LPVOID extended) 00020 { 00021 // thread for handling Splash Screen 00022 00023 CreateSplash(4, (Bool_t)extended); 00024 if (gSplash) delete gSplash; 00025 gSplash = 0; 00026 return 0; 00027 } 00028 00029 //______________________________________________________________________________ 00030 TWin32SplashThread::TWin32SplashThread(Bool_t extended) 00031 { 00032 // ctor. 00033 fHandle = 0; 00034 DWORD splashId = 0; 00035 fHandle = ::CreateThread( NULL, 0,&HandleSplashThread, (LPVOID)extended, 0, &splashId ); 00036 gSplash = this; 00037 } 00038 00039 //______________________________________________________________________________ 00040 TWin32SplashThread::~TWin32SplashThread() 00041 { 00042 // dtor 00043 00044 DestroySplashScreen(); 00045 TerminateThread(fHandle, 0); 00046 if (fHandle) ::CloseHandle(fHandle); 00047 fHandle = 0; 00048 } 00049