Synchronisation with explorer source code

svn path=/trunk/; revision=15227
This commit is contained in:
Martin Fuchs 2005-05-11 19:12:26 +00:00
parent 7862b7c070
commit b269a8333e

View file

@ -182,9 +182,9 @@ using namespace _com_util;
// launch a program or document file
extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters=NULL);
extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow=SW_SHOWNORMAL, LPCTSTR parameters=NULL);
#ifdef UNICODE
extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow, LPCSTR parameters=NULL);
extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow=SW_SHOWNORMAL, LPCSTR parameters=NULL);
#else
#define launch_fileA launch_file
#endif
@ -300,16 +300,22 @@ protected:
struct Thread
{
Thread()
: _alive(false)
: _alive(false),
_destroy(false)
{
_hThread = INVALID_HANDLE_VALUE;
_evtFinish = CreateEvent(NULL, TRUE, FALSE, NULL);
}
virtual ~Thread()
{
Stop();
CloseHandle(_evtFinish);
CloseHandle(_hThread);
if (_destroy)
delete this;
}
void Start()
@ -322,6 +328,8 @@ struct Thread
void Stop()
{
SetEvent(_evtFinish);
if (_alive) {
{
Lock lock(_crit_sect);
@ -343,7 +351,9 @@ protected:
static DWORD WINAPI ThreadProc(void* para);
HANDLE _hThread;
HANDLE _evtFinish;
bool _alive;
bool _destroy;
};