|
 |
|
|
hi friends.. Can i get the name of exe which is running foreground... For example when plalying counter strike, czero.exe is running..How can i get the name 'czero.exe'...? I am working in vc++
-- modified at 8:37 Monday 23rd October, 2006
|
| Sign In·View Thread·PermaLink | 4.20/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
.. the previous version of this source that I'd downloaded a couple of years ago didn't have this, and it was starting to be a real pain because of multiple instances using same EXE name. Nice one. Where do you find the info on this stuff?, I could never figure out how to add the ID version because of lack of documentation.
thx again.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Dear All, Can anybody let me know how to kill the running process (In WINDOWS SDK)??? I am using the TerminateProcess() functionin which it requires the Handle of the process...How do I get the handle of process ??? Let me tell U,I am not getting the required Output by GetHandle() method... Thanks in advance. Supriya Tonape
|
| Sign In·View Thread·PermaLink | 4.40/5 (2 votes) |
|
|
|
 |
|
|
Hello,
Here is the sample code to terminate Notepad application...
========================== HANDLE snapshot; PROCESSENTRY32 process_entry;
snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (snapshot == INVALID_HANDLE_VALUE) return false;
process_entry.dwSize = sizeof(PROCESSENTRY32); BOOL success = Process32First(snapshot, &process_entry); DWORD pid; const char program[] = "notepad.exe"; while (success) { if (_strnicmp(program, process_entry.szExeFile, sizeof(process_entry.szExeFile)) == 0) { // is running. pid = process_entry.th32ProcessID; break; } success = Process32Next(snapshot, &process_entry); }
DWORD exitCode; HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); if (hProcess) { if (::GetExitCodeProcess(hProcess, &exitCode)) { ::TerminateProcess(hProcess, exitCode); } }
===========================
regards, Ameen
|
| Sign In·View Thread·PermaLink | 5.00/5 (3 votes) |
|
|
|
 |
|
|
will this woork on UNIX? if no, can you suggest some code for UNIX platform
Thanks in advance vish
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
will this work on UNIX? if no, can you suggest some code for UNIX platform
Thanks in advance vish
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Hello. What is the diffrence between process id and process handle and your code gime me which of this and how to change thease to each other?
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Hello How can I get the process ID of process ( application ) which is in foreground ? I used GetForegroundWindow() and GetWindowThreadProcessId() to get the process ID. But GetWindowThreadProcessId returns me the same PID each time. ( It returns me the PID of explorer.exe each time ) What can I do to get the correct process ID ?
Ajay
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hey
I'm reading about HKEY_PERFORMANCE_DATA key in MSDN, and it is clearly said that :: be sure to use the RegCloseKey function to close the handle to the key when you are finished obtaining performance data. The user cannot install or remove a software component while its performance data is in use.
Is there any reason why you aren't closing that handle.
I Hate Win98
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Well, it is strange because i fixed that in 19.9.2003 (See in Updates section in my article). However, thanks for letting me know.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi, I need to get the owner name and pid of all process running in NT4. I will appreciate a lot if you can provide me a hint.
Thanking you, Kuntal Mondal
|
| Sign In·View Thread·PermaLink | 1.33/5 (3 votes) |
|
|
|
 |
|
|
 |
|
|
Is this code thread safe cause I am having access denied error while two thread is trying to access the code?
Could you help me to get it thread safe? thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
WMI is native for Win2000/XP. It also works for Win95/98/NT4 after installing WMICore. WMI has WQL - the language with great possibility of creating query. And WMI accessible for C++, C#, Java, Delphi, VB, Windows Script.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Hi,
I'd like to use your application, but... It takes several seconds on my P4 2.0 Ghz to give me the answer. Do you have the same performance on your system. Any idea to improve speed?
Thanks, Arnaud
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
I dont have that problem. Check whether there are many memory re-allocations in the following loop:
while( (lRes = RegQueryValueEx( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, (LPBYTE) pPerfData, &BufferSize )) == ERROR_MORE_DATA ) { // Get a buffer that is big enough.
BufferSize += BYTEINCREMENT; pPerfData = (PPERF_DATA_BLOCK) realloc( pPerfData, BufferSize ); }
If there are, then change the TOTALBYTES and BYTEINCREMENT values. I hope it will help you.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
When I use NT Performance Monitor in my computer, I cann't see the performance object "Process" and "Thread"! Do you know what's wrong with my win2k system? Os is Microsoft windows 2000, version: 5.00.2195, Service Pack 3.
Every is my teacher!(From China saying )
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
Hi,
whether the given code is compactible to Win9x, if not then any method that will do the same task
|
| Sign In·View Thread·PermaLink | 1.20/5 (2 votes) |
|
|
|
 |
|
|
hi all, I want to get process id from process handle, in VB. or if any of u can give me VB declaration of GetProcessId API.
Ravi Shingote
|
| Sign In·View Thread·PermaLink | 2.33/5 (6 votes) |
|
|
|
 |