Click here to Skip to main content
16,014,752 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to Delete a used file in C++? Pin
Jerry.Wang20-Mar-09 4:08
Jerry.Wang20-Mar-09 4:08 
QuestionRe: How to Delete a used file in C++? Pin
David Crow20-Mar-09 2:59
David Crow20-Mar-09 2:59 
AnswerRe: How to Delete a used file in C++? Pin
Maximilien20-Mar-09 3:09
Maximilien20-Mar-09 3:09 
QuestionObtaining process name from process handle [modified] Pin
hxhl9519-Mar-09 19:42
hxhl9519-Mar-09 19:42 
AnswerRe: Obtaining process name from process handle Pin
«_Superman_»19-Mar-09 19:53
professional«_Superman_»19-Mar-09 19:53 
GeneralRe: Obtaining process name from process handle Pin
hxhl9519-Mar-09 19:59
hxhl9519-Mar-09 19:59 
GeneralRe: Obtaining process name from process handle Pin
«_Superman_»19-Mar-09 20:03
professional«_Superman_»19-Mar-09 20:03 
GeneralRe: Obtaining process name from process handle [modified] Pin
hxhl9520-Mar-09 5:56
hxhl9520-Mar-09 5:56 
Not UNICODE.

I'm going to give GetModuleBaseName a try, but according to msdn:

MSDN:

To retrieve the base name of the main executable module for a remote process, use the GetProcessImageFileName or QueryFullProcessImageName function to retrieve the module name and then use the strrchr function as described in the previous paragraph. This is more efficient and more reliable than calling GetModuleBaseName with a NULL module handle.


EDIT/update: GetModuleBaseName also returns garbage...

GetModuleBaseName(ProcessHandle,NULL,processName,1024);
MessageBox(NULL,processName,"test",MB_ICONINFORMATION);


modified on Friday, March 20, 2009 12:02 PM

GeneralRe: Obtaining process name from process handle Pin
«_Superman_»21-Mar-09 3:31
professional«_Superman_»21-Mar-09 3:31 
QuestionRe: Obtaining process name from process handle [modified] Pin
hxhl9521-Mar-09 8:12
hxhl9521-Mar-09 8:12 
AnswerRe: Obtaining process name from process handle Pin
David Crow20-Mar-09 3:02
David Crow20-Mar-09 3:02 
QuestionRe: Obtaining process name from process handle Pin
hxhl9520-Mar-09 5:54
hxhl9520-Mar-09 5:54 
AnswerRe: Obtaining process name from process handle Pin
David Crow20-Mar-09 6:00
David Crow20-Mar-09 6:00 
QuestionRe: Obtaining process name from process handle Pin
hxhl9520-Mar-09 6:08
hxhl9520-Mar-09 6:08 
AnswerRe: Obtaining process name from process handle Pin
David Crow20-Mar-09 7:16
David Crow20-Mar-09 7:16 
GeneralRe: Obtaining process name from process handle Pin
hxhl9520-Mar-09 7:23
hxhl9520-Mar-09 7:23 
QuestionRe: Obtaining process name from process handle Pin
David Crow20-Mar-09 7:31
David Crow20-Mar-09 7:31 
QuestionRe: Obtaining process name from process handle Pin
hxhl9520-Mar-09 8:04
hxhl9520-Mar-09 8:04 
AnswerRe: Obtaining process name from process handle Pin
David Crow20-Mar-09 8:16
David Crow20-Mar-09 8:16 
GeneralRe: Obtaining process name from process handle Pin
hxhl9520-Mar-09 10:08
hxhl9520-Mar-09 10:08 
QuestionMFC + Threading = C2665 Pin
Killiconn19-Mar-09 14:43
Killiconn19-Mar-09 14:43 
AnswerRe: MFC + Threading = C2665 Pin
«_Superman_»19-Mar-09 19:03
professional«_Superman_»19-Mar-09 19:03 
GeneralRe: MFC + Threading = C2665 Pin
Killiconn20-Mar-09 10:50
Killiconn20-Mar-09 10:50 
GeneralRe: MFC + Threading = C2665 Pin
«_Superman_»21-Mar-09 3:34
professional«_Superman_»21-Mar-09 3:34 
GeneralRe: MFC + Threading = C2665 Pin
Killiconn21-Mar-09 10:01
Killiconn21-Mar-09 10:01 

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.