Synchronisation with explorer source code
Modified: trunk/reactos/subsys/system/ibrowser/utility/utility.h

Modified: trunk/reactos/subsys/system/ibrowser/utility/utility.h
--- trunk/reactos/subsys/system/ibrowser/utility/utility.h	2005-05-11 19:12:03 UTC (rev 15226)
+++ trunk/reactos/subsys/system/ibrowser/utility/utility.h	2005-05-11 19:12:26 UTC (rev 15227)
@@ -182,9 +182,9 @@
 
 
  // 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 @@
 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 @@
 
 	void Stop()
 	{
+		SetEvent(_evtFinish);
+
 		if (_alive) {
 			{
 			Lock lock(_crit_sect);
@@ -343,7 +351,9 @@
 	static DWORD WINAPI ThreadProc(void* para);
 
 	HANDLE	_hThread;
+	HANDLE	_evtFinish;
 	bool	_alive;
+	bool	_destroy;
 };