Click here to Skip to main content
15,909,332 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: keyboard events Pin
mahesh kumar s12-Oct-04 18:53
mahesh kumar s12-Oct-04 18:53 
QuestionHow to show our own custom Print Dialog page from Word Pin
prince1a12-Oct-04 2:22
prince1a12-Oct-04 2:22 
GeneralC# Webservice in C++ Pin
_Hacker12-Oct-04 2:07
suss_Hacker12-Oct-04 2:07 
Questionposting code? Pin
7stud12-Oct-04 0:42
7stud12-Oct-04 0:42 
AnswerRe: posting code? Pin
Neville Franks12-Oct-04 1:08
Neville Franks12-Oct-04 1:08 
GeneralVC++ Code to control and monitor processes and applications Pin
maha srikanth12-Oct-04 0:29
sussmaha srikanth12-Oct-04 0:29 
GeneralRe: VC++ Code to control and monitor processes and applications Pin
Antony M Kancidrowski12-Oct-04 4:01
Antony M Kancidrowski12-Oct-04 4:01 
GeneralRe: VC++ Code to control and monitor processes and applications Pin
sweep12312-Oct-04 4:09
sweep12312-Oct-04 4:09 
You could try the following code I modified to determine if a process is still running, deals with multiple instances:-

bool CExampleDlg::CheckProcess(CString processName, int instance)<br />
{<br />
	/* Check if process still running. Just use 0 for single instance<br />
           Returns true if still running.	*/<br />
<br />
	HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />
	PROCESSENTRY32* processInfo = new PROCESSENTRY32;<br />
	processInfo->dwSize = sizeof(PROCESSENTRY32);<br />
	bool returnValue = false;<br />
	bool handleFound = false;<br />
	DWORD processID = 0;<br />
	HANDLE CSLProcess = NULL;<br />
<br />
	// Here we are passing snapshot handle and PROCESSENTRY32 structure to Process32Next() <br />
	// function. After execution, PROCESSENTRY32 structure will contain information about a process. <br />
	// We are iterating through a loop until we got FALSE and this means there is now no process left to visit in snapshot and our pointer is at the end of snapshot.<br />
<br />
	returnValue = false;<br />
	handleFound = false;<br />
	processID = 0;	// Init it<br />
	// But first do the 1st entry on its own!<br />
	Process32First(hSnapShot,processInfo);<br />
<br />
	// See if this name matches 'processName'; 0 = match<br />
	if(strcmp(processInfo->szExeFile, processName) == 0)<br />
	{<br />
		processID = processInfo->th32ParentProcessID;<br />
		if(instance == 0)<br />
		{<br />
			returnValue = true;<br />
			handleFound = true;			// Get our entry<br />
		}<br />
		else<br />
		{<br />
			if(processID == Idux_ProcID[instance - 1])<br />
			{<br />
				handleFound = true;			// Get our entry<br />
				returnValue = true;<br />
			}<br />
		}<br />
	}<br />
	while((Process32Next(hSnapShot,processInfo)!=FALSE) && (handleFound == false))<br />
	{<br />
		// See if this name matches 'processName'; 0 = match<br />
		if(strcmp(processInfo->szExeFile, processName) == 0)<br />
		{<br />
			processID = processInfo->th32ProcessID;<br />
			if(instance == 0)<br />
			{<br />
				returnValue = true;<br />
				handleFound = true;			// Get our entry<br />
			}<br />
			else<br />
			{<br />
				if(processID == Idux_ProcID[instance - 1])<br />
				{<br />
					handleFound = true;			// Get our entry<br />
					returnValue = true;<br />
				}<br />
			}<br />
		}<br />
	}<br />
<br />
	//Don’t forget to close handle.<br />
	CloseHandle(hSnapShot);<br />
	delete processInfo;<br />
<br />
	return returnValue;<br />
}

Generalcompatibility between vc++ 6.0 and vc++.net Pin
amey nikumbh11-Oct-04 23:27
amey nikumbh11-Oct-04 23:27 
Generaldifference between RGB type and YUV type Pin
Guoguor11-Oct-04 23:11
Guoguor11-Oct-04 23:11 
GeneralRe: difference between RGB type and YUV type Pin
rrrado11-Oct-04 23:43
rrrado11-Oct-04 23:43 
GeneralRe: difference between RGB type and YUV type Pin
David Crow12-Oct-04 6:49
David Crow12-Oct-04 6:49 
QuestionHow to write the BITMAPINFOHEADER Pin
Guoguor11-Oct-04 23:09
Guoguor11-Oct-04 23:09 
AnswerHelp! Additional question Pin
Guoguor11-Oct-04 23:19
Guoguor11-Oct-04 23:19 
GeneralRe: Help! Additional question Pin
Sujan Christo11-Oct-04 23:32
Sujan Christo11-Oct-04 23:32 
GeneralCToolBar on a MFC Dialog Pin
sweep12311-Oct-04 23:04
sweep12311-Oct-04 23:04 
Questionhow to use enumfonts? Pin
Lido Paul11-Oct-04 22:54
Lido Paul11-Oct-04 22:54 
AnswerRe: how to use enumfonts? Pin
David Crow12-Oct-04 6:57
David Crow12-Oct-04 6:57 
Generalchar * &amp; char [] Pin
sarath_babu11-Oct-04 22:52
sarath_babu11-Oct-04 22:52 
GeneralRe: char * &amp; char [] Pin
Bob Stanneveld11-Oct-04 23:33
Bob Stanneveld11-Oct-04 23:33 
GeneralRe: char * &amp; char [] Pin
rrrado11-Oct-04 23:41
rrrado11-Oct-04 23:41 
GeneralRe: char * &amp; char [] Pin
rrrado11-Oct-04 23:35
rrrado11-Oct-04 23:35 
Generalnon-modal dialog in dll Pin
Frank Conrad11-Oct-04 21:47
Frank Conrad11-Oct-04 21:47 
GeneralRe: non-modal dialog in dll Pin
Vikrant for VC++11-Oct-04 22:19
Vikrant for VC++11-Oct-04 22:19 
GeneralRe: non-modal dialog in dll Pin
Frank Conrad11-Oct-04 22:32
Frank Conrad11-Oct-04 22:32 

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.