Click here to Skip to main content
15,902,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Default path to Desktop with vista Pin
dbell0715-Jan-10 10:49
dbell0715-Jan-10 10:49 
GeneralRe: Default path to Desktop with vista Pin
Rozis16-Jan-10 10:28
Rozis16-Jan-10 10:28 
GeneralRe: Default path to Desktop with vista Pin
Spawn@Melmac18-Jan-10 0:35
Spawn@Melmac18-Jan-10 0:35 
QuestionShowing and Closing Dialogs in C++ Pin
NightBeforeChirstmas15-Jan-10 9:29
NightBeforeChirstmas15-Jan-10 9:29 
AnswerRe: Showing and Closing Dialogs in C++ Pin
Maximilien15-Jan-10 9:31
Maximilien15-Jan-10 9:31 
AnswerRe: Showing and Closing Dialogs in C++ Pin
David Crow15-Jan-10 9:48
David Crow15-Jan-10 9:48 
AnswerRe: Showing and Closing Dialogs in C++ Pin
Bram van Kampen17-Jan-10 6:35
Bram van Kampen17-Jan-10 6:35 
QuestionRetrieving Windows version, then enumerating process list Pin
int_8015-Jan-10 5:49
int_8015-Jan-10 5:49 
I need to find out what version of windows is running - Vista/Win7/XP and then get a list of processes. So far, for the list of processes I've got this:

bool isRunning(std::string pName) 
{
	unsigned long aProcesses[1024], cbNeeded, cProcesses;
	if(!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded))
		return false;

	cProcesses = cbNeeded / sizeof(unsigned long);
	for(unsigned int i = 0; i < cProcesses; i++)
	{
		if(aProcesses[i] == 0)
			continue;
		HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, aProcesses[i]);
		char buffer[50];
		GetModuleBaseName(hProcess, 0, buffer, 50);
		CloseHandle(hProcess);

		if(pName == std::string(buffer))
			return true;
	}
	return false;
}


This is supposed to get a list of processes, then return true if process X is running. But in Windows 7 it never returns true. Developing cross platform code for windows machines is getting as bad as Linux now. I'm fairly new to windows coding and I'm finding it nightmarish.

Thanks in advance.
QuestionRe: Retrieving Windows version, then enumerating process list Pin
David Crow15-Jan-10 7:53
David Crow15-Jan-10 7:53 
AnswerRe: Retrieving Windows version, then enumerating process list Pin
CPallini15-Jan-10 11:06
mveCPallini15-Jan-10 11:06 
Questionhow to draw a graph on 2 axes in a window Pin
N Vamshi Krishna15-Jan-10 5:39
N Vamshi Krishna15-Jan-10 5:39 
QuestionRe: how to draw a graph on 2 axes in a window Pin
CPallini15-Jan-10 5:51
mveCPallini15-Jan-10 5:51 
AnswerRe: how to draw a graph on 2 axes in a window Pin
N Vamshi Krishna15-Jan-10 6:10
N Vamshi Krishna15-Jan-10 6:10 
GeneralRe: how to draw a graph on 2 axes in a window Pin
CPallini15-Jan-10 6:33
mveCPallini15-Jan-10 6:33 
GeneralRe: how to draw a graph on 2 axes in a window Pin
Cedric Moonen15-Jan-10 7:29
Cedric Moonen15-Jan-10 7:29 
GeneralRe: how to draw a graph on 2 axes in a window Pin
CPallini15-Jan-10 7:45
mveCPallini15-Jan-10 7:45 
Questionbeginner, simple c question. Pin
antionette15-Jan-10 4:39
antionette15-Jan-10 4:39 
AnswerRe: beginner, simple c question. Pin
Richard MacCutchan15-Jan-10 4:45
mveRichard MacCutchan15-Jan-10 4:45 
GeneralRe: beginner, simple c question. Pin
Chris Losinger15-Jan-10 5:11
professionalChris Losinger15-Jan-10 5:11 
GeneralRe: beginner, simple c question. [modified] Pin
Richard MacCutchan15-Jan-10 5:38
mveRichard MacCutchan15-Jan-10 5:38 
JokeRe: beginner, simple c question. Pin
loyal ginger15-Jan-10 4:58
loyal ginger15-Jan-10 4:58 
GeneralRe: beginner, simple c question. Pin
dxlee15-Jan-10 5:13
dxlee15-Jan-10 5:13 
AnswerRe: beginner, simple c question. Pin
CPallini15-Jan-10 5:05
mveCPallini15-Jan-10 5:05 
AnswerRe: beginner, simple c question. Pin
Chris Losinger15-Jan-10 5:07
professionalChris Losinger15-Jan-10 5:07 
GeneralRe: beginner, simple c question. Pin
Richard MacCutchan15-Jan-10 6:55
mveRichard MacCutchan15-Jan-10 6:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.