| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /***********************************************************************************************
- *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
- ***********************************************************************************************
- * *
- * Project Name : LevelEdit *
- * *
- * $Archive:: /Commando/Code/Tools/LevelEdit/Splash.cpp $*
- * *
- * Author:: Patrick Smith *
- * *
- * $Modtime:: 12/07/99 5:51p $*
- * *
- * $Revision:: 2 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #include "stdafx.h"
- #include "Splash.h"
- #include "SplashScreen.h"
- #include "Utils.h"
- ///////////////////////////////////////////////////////////////////////
- // Forward declarations
- ///////////////////////////////////////////////////////////////////////
- UINT fnSplashScreenThread (DWORD, DWORD, DWORD, HRESULT *, HWND *phmain_wnd);
- ///////////////////////////////////////////////////////////////////////
- //
- // SplashClass
- //
- ///////////////////////////////////////////////////////////////////////
- SplashClass::SplashClass (void)
- : m_hThreadWnd (NULL)
- {
- return ;
- }
- ///////////////////////////////////////////////////////////////////////
- //
- // ~SplashClass
- //
- ///////////////////////////////////////////////////////////////////////
- SplashClass::~SplashClass (void)
- {
- Close ();
- return ;
- }
- ///////////////////////////////////////////////////////////////////////
- //
- // Set_Status_Text
- //
- ///////////////////////////////////////////////////////////////////////
- void
- SplashClass::Set_Status_Text (LPCTSTR text)
- {
- if (m_hThreadWnd != NULL) {
- ::PostMessage (m_hThreadWnd, WM_USER+102, 0, (LPARAM)text);
- }
- return ;
- }
- ///////////////////////////////////////////////////////////////////////
- //
- // Show
- //
- ///////////////////////////////////////////////////////////////////////
- void
- SplashClass::Show (bool show)
- {
- //
- // Kick off a thread that will display the splash screen
- //
- if (m_hThreadWnd == NULL) {
- ::Create_UI_Thread (fnSplashScreenThread, 0, 0, 0, NULL, &m_hThreadWnd);
- }
- ::ShowWindow (m_hThreadWnd, show ? SW_SHOW : SW_HIDE);
- //
- // Register ourselves as the current status window
- //
- if (show) {
- ProgressUIMgrClass::Set_Current_Progress_UI (this);
- }
- return ;
- }
- ///////////////////////////////////////////////////////////////////////
- //
- // Close
- //
- ///////////////////////////////////////////////////////////////////////
- void
- SplashClass::Close (void)
- {
- //
- // Close out the window
- //
- if (::IsWindow (m_hThreadWnd)) {
- ::PostMessage (m_hThreadWnd, WM_USER+101, 0, 0L);
- m_hThreadWnd = NULL;
- }
- if (ProgressUIMgrClass::Get_Current_Progress_UI () == this) {
- ProgressUIMgrClass::Set_Current_Progress_UI (NULL);
- }
- return ;
- }
- /////////////////////////////////////////////////////////////////////////////
- //
- // fnSplashScreenThread
- //
- ////////////////////////////////////////////////////////////////////////////
- UINT
- fnSplashScreenThread
- (
- DWORD /*dwparam1*/,
- DWORD /*dwparam2*/,
- DWORD /*dwparam3*/,
- HRESULT* /*presult*/,
- HWND* phmain_wnd
- )
- {
- //
- // Create a new instance of the 'updating' dialog
- //
- SplashScreenClass *splash_wnd = new SplashScreenClass;
- splash_wnd->CreateEx (0, "STATIC", "Level Edit", WS_POPUP | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL);
- splash_wnd->ShowWindow (SW_SHOW);
- //
- // Return the window handle of the main wnd to the calling thread
- //
- if (phmain_wnd != NULL) {
- (*phmain_wnd) = splash_wnd->m_hWnd;
- }
- return 1;
- }
|