Click here to Skip to main content
15,913,304 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionsend message to Yahoo user Pin
Silly Boy24-Aug-06 7:15
Silly Boy24-Aug-06 7:15 
QuestionRe: send message to Yahoo user Pin
David Crow24-Aug-06 7:37
David Crow24-Aug-06 7:37 
AnswerRe: send message to Yahoo user Pin
jk chan24-Aug-06 14:27
jk chan24-Aug-06 14:27 
AnswerRe: send message to Yahoo user Pin
ThatsAlok24-Aug-06 18:08
ThatsAlok24-Aug-06 18:08 
QuestionChanging bitmaps using UpdateResource Pin
Kharfax24-Aug-06 7:09
Kharfax24-Aug-06 7:09 
AnswerRe: Changing bitmaps using UpdateResource Pin
David Crow24-Aug-06 7:36
David Crow24-Aug-06 7:36 
GeneralRe: Changing bitmaps using UpdateResource Pin
Kharfax24-Aug-06 7:46
Kharfax24-Aug-06 7:46 
GeneralRe: Changing bitmaps using UpdateResource Pin
$motty24-Aug-06 8:18
$motty24-Aug-06 8:18 
GeneralRe: Changing bitmaps using UpdateResource Pin
Kharfax24-Aug-06 8:27
Kharfax24-Aug-06 8:27 
GeneralRe: Changing bitmaps using UpdateResource Pin
jk chan24-Aug-06 14:42
jk chan24-Aug-06 14:42 
GeneralRe: Changing bitmaps using UpdateResource Pin
Kharfax25-Aug-06 2:21
Kharfax25-Aug-06 2:21 
AnswerProblem solved Pin
Kharfax25-Aug-06 4:40
Kharfax25-Aug-06 4:40 
Questionmemcpy and memset on a structure which has a class as it's member Pin
Diagon Alley24-Aug-06 5:09
Diagon Alley24-Aug-06 5:09 
AnswerRe: memcpy and memset on a structure which has a class as it's member Pin
toxcct24-Aug-06 6:14
toxcct24-Aug-06 6:14 
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 

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.