nux-1.16.0
|
00001 /* 00002 * Copyright 2010 Inalogic® Inc. 00003 * 00004 * This program is free software: you can redistribute it and/or modify it 00005 * under the terms of the GNU Lesser General Public License, as 00006 * published by the Free Software Foundation; either version 2.1 or 3.0 00007 * of the License. 00008 * 00009 * This program is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranties of 00011 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR 00012 * PURPOSE. See the applicable version of the GNU Lesser General Public 00013 * License for more details. 00014 * 00015 * You should have received a copy of both the GNU Lesser General Public 00016 * License along with this program. If not, see <http://www.gnu.org/licenses/> 00017 * 00018 * Authored by: Jay Taoko <jaytaoko@inalogic.com> 00019 * 00020 */ 00021 00022 00023 #ifndef NPROCESS_H 00024 #define NPROCESS_H 00025 00026 namespace nux 00027 { 00028 00029 #ifdef _WIN32 00030 00034 void inlLaunchURL ( const TCHAR *URL, const TCHAR *Parms = NULL, NString *Error = NULL ); 00035 void *inlCreateProc ( const TCHAR *URL, const TCHAR *Parms ); 00037 BOOL inlGetProcReturnCode ( void *ProcessHandle, INT *ReturnCode ); 00038 00039 #endif 00040 00041 class NProcess 00042 { 00043 NUX_DECLARE_GLOBAL_OBJECT (NProcess, GlobalSingletonInitializer); 00044 public: 00045 00046 DWORD GetProcessID(); 00047 DWORD GetMainThreadID(); 00048 DWORD GetCurrentThreadID(); 00049 private: 00050 00051 #ifdef _WIN32 00052 HANDLE GetProcessHandle(); 00053 HANDLE GetMainThreadHandle(); 00054 HANDLE GetCurrentThreadHandle(); 00055 00056 HANDLE m_ProcessHandle; 00057 DWORD m_ProcessID; 00058 HANDLE m_MainThreadHandle; 00059 DWORD m_MainThreadID; 00060 #endif 00061 00062 }; 00063 00064 } 00065 00066 #endif // NPROCESS_H