Click here to Skip to main content
15,888,802 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: memcpy and memset on a structure which has a class as it's member Pin
cmk24-Aug-06 7:08
cmk24-Aug-06 7:08 
AnswerRe: memcpy and memset on a structure which has a class as it's member Pin
Zac Howland25-Aug-06 9:19
Zac Howland25-Aug-06 9:19 
AnswerThanks Guys! Pin
Diagon Alley29-Aug-06 18:58
Diagon Alley29-Aug-06 18:58 
QuestionChanging tray icon tooltip message Pin
samaruf24-Aug-06 5:01
samaruf24-Aug-06 5:01 
AnswerRe: Changing tray icon tooltip message Pin
Waldermort24-Aug-06 7:55
Waldermort24-Aug-06 7:55 
GeneralRe: Changing tray icon tooltip message Pin
ThatsAlok24-Aug-06 18:10
ThatsAlok24-Aug-06 18:10 
GeneralRe: Changing tray icon tooltip message Pin
Waldermort24-Aug-06 22:54
Waldermort24-Aug-06 22:54 
QuestionConfussion with Assigning an applications's process priority [modified] Pin
kitty524-Aug-06 5:01
kitty524-Aug-06 5:01 
After reading the article:
Enumerating processes : A practical approach By Irfan Dawood.

I found this really helpfull with what I have to do.
However, I only have the name of the application (hello.exe). The processInfo=new PROCESSENTRY32; has a member variable: szExeFile which is a:
"Pointer to a null-terminated string that specifies the name of the executable file for the process. "
I figure after getting all the processes if I just search for my process using the name I can obtain the process ID of the "hello.exe" process therefore then be able to set the priority:

	//Here we are trying to get all possible access.<br />
	HANDLE hProcess=OpenProcess(PROCESS_ALL_ACCESS,TRUE,processID);<br />
	if(hProcess==NULL)<br />
	{<br />
		 cout<<"Unable to get handle of process: "<<processID;<br />
		 cout<<"Error is: "<<GetLastError();<br />
		 return 1;<br />
	}<br />
	//Now we have handle of a process and we can do all types of magical things. Here we are getting priority value of process using GetPriorityClass() function and then setting priority to high using SetPriorityClass() function.<br />
<br />
	cout<<endl<<"Priority Class: "<<GetPriorityClass(hProcess);<br />
	SetPriorityClass(hProcess,HIGH_PRIORITY_CLASS);<br />
	CloseHandle(hProcess);


but whenever I try to do: if( processInfo->szExeFile == _T("hello.exe")) it doesn't work. and when I try to print out cout<<endl<<"Name: "<<processInfo->szExeFile; I get "Name: 0036630C"...

Am I completely off my rocker?
Thanks,


-- modified at 11:36 Thursday 24th August, 2006


-- modified at 11:44 Thursday 24th August, 2006

Kitty5

AnswerRe: Confussion with Assigning an applications's process priority Pin
Waldermort24-Aug-06 7:47
Waldermort24-Aug-06 7:47 
Questionwave file bandpass filter (with FFT?) Pin
ilFrate24-Aug-06 3:39
ilFrate24-Aug-06 3:39 
AnswerRe: wave file bandpass filter (with FFT?) Pin
Jun Du24-Aug-06 7:11
Jun Du24-Aug-06 7:11 
GeneralRe: wave file bandpass filter (with FFT?) Pin
ilFrate24-Aug-06 21:43
ilFrate24-Aug-06 21:43 
QuestionTemplate specialization with static data member Pin
tuxyboy24-Aug-06 3:09
tuxyboy24-Aug-06 3:09 
QuestionBitmap transparency at picture_control [modified] Pin
Jarley D.G.24-Aug-06 2:52
Jarley D.G.24-Aug-06 2:52 
AnswerRe: Bitmap transparency at picture_control Pin
KarstenK24-Aug-06 3:36
mveKarstenK24-Aug-06 3:36 
AnswerRe: Bitmap transparency at picture_control Pin
Waldermort24-Aug-06 4:11
Waldermort24-Aug-06 4:11 
AnswerRe: Bitmap transparency at picture_control Pin
Justin Tay24-Aug-06 4:25
Justin Tay24-Aug-06 4:25 
GeneralRe: Bitmap transparency at picture_control Pin
Jarley D.G.24-Aug-06 5:26
Jarley D.G.24-Aug-06 5:26 
QuestionSafe functions after heap corruption? Pin
chilituna24-Aug-06 2:20
chilituna24-Aug-06 2:20 
AnswerRe: Safe functions after heap corruption? Pin
David Crow24-Aug-06 2:38
David Crow24-Aug-06 2:38 
AnswerRe: Safe functions after heap corruption? Pin
Stephen Hewitt24-Aug-06 17:35
Stephen Hewitt24-Aug-06 17:35 
AnswerRe: Safe functions after heap corruption? Pin
ThatsAlok24-Aug-06 18:20
ThatsAlok24-Aug-06 18:20 
AnswerRe: Safe functions after heap corruption? Pin
chilituna24-Aug-06 23:37
chilituna24-Aug-06 23:37 
QuestionIntilaisation Problem (colors, icons to the button) Pin
kiranin24-Aug-06 2:08
kiranin24-Aug-06 2:08 
AnswerRe: Intilaisation Problem (colors, icons to the button) Pin
prasad_som24-Aug-06 2:21
prasad_som24-Aug-06 2:21 

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.