Click here to Skip to main content
15,905,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: find diffrence between current time and birthday as a number of days. [modified] Pin
Luc Pattyn10-May-11 8:16
sitebuilderLuc Pattyn10-May-11 8:16 
GeneralRe: find diffrence between current time and birthday as a number of days. Pin
Ram Shelke10-May-11 19:53
Ram Shelke10-May-11 19:53 
GeneralRe: find diffrence between current time and birthday as a number of days. Pin
Le@rner10-May-11 21:11
Le@rner10-May-11 21:11 
GeneralRe: find diffrence between current time and birthday as a number of days. Pin
quartaela11-May-11 10:57
quartaela11-May-11 10:57 
AnswerRe: find diffrence between current time and birthday as a number of days. Pin
Luc Pattyn11-May-11 0:05
sitebuilderLuc Pattyn11-May-11 0:05 
GeneralRe: find diffrence between current time and birthday as a number of days. Pin
quartaela11-May-11 11:02
quartaela11-May-11 11:02 
AnswerRe: find diffrence between current time and birthday as a number of days. Pin
turboscrew16-May-11 23:02
turboscrew16-May-11 23:02 
QuestionGetting the User Name for a Process Pin
Rajesh_Parameswaran10-May-11 5:23
Rajesh_Parameswaran10-May-11 5:23 
Hi there,

I'm working on a Application developed using Visual Studio 2008 (VC++).
I'm looking for a way to get the name of the current user session using the process ID.

My intention here is to check for a particular process (AA.exe) and see this is not running for a current user.
I'm using the CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL) to get the list of process, and traverse thru the list for a matching AA.exe process. But this returns the list of processes from all users.

I've gone thru the example:
List Processes Which Are Created By Specific Users[^]

But the function LookupAccountSid() returns 0 and the get last error also returns 0.
The value of the username field seems to be NULL.

Kindly let me know, if there are any other ways to get the name of the current user session using the Process ID.

Thanks in advance.

regards,
Rajesh
AnswerRe: Getting the User Name for a Process Pin
Mark Salsbery10-May-11 10:46
Mark Salsbery10-May-11 10:46 
GeneralRe: Getting the User Name for a Process Pin
Rajesh_Parameswaran10-May-11 14:52
Rajesh_Parameswaran10-May-11 14:52 
Questionstring combination Pin
john56329-May-11 20:20
john56329-May-11 20:20 
QuestionRe: string combination Pin
Niklas L9-May-11 21:03
Niklas L9-May-11 21:03 
AnswerRe: string combination Pin
john56329-May-11 21:28
john56329-May-11 21:28 
GeneralRe: string combination Pin
barneyman9-May-11 21:44
barneyman9-May-11 21:44 
GeneralRe: string combination Pin
john56329-May-11 23:29
john56329-May-11 23:29 
GeneralRe: string combination Pin
Niklas L10-May-11 0:18
Niklas L10-May-11 0:18 
AnswerRe: string combination Pin
Niklas L9-May-11 22:25
Niklas L9-May-11 22:25 
AnswerRe: string combination Pin
varunpandeyengg9-May-11 22:52
varunpandeyengg9-May-11 22:52 
GeneralRe: string combination Pin
CPallini9-May-11 23:42
mveCPallini9-May-11 23:42 
GeneralRe: string combination Pin
john56329-May-11 23:51
john56329-May-11 23:51 
GeneralRe: string combination Pin
CPallini9-May-11 23:59
mveCPallini9-May-11 23:59 
GeneralRe: string combination Pin
varunpandeyengg10-May-11 0:18
varunpandeyengg10-May-11 0:18 
GeneralRe: string combination PinPopular
john563210-May-11 0:22
john563210-May-11 0:22 
GeneralRe: string combination Pin
varunpandeyengg10-May-11 21:03
varunpandeyengg10-May-11 21:03 
GeneralRe: string combination Pin
Chris Losinger10-May-11 3:24
professionalChris Losinger10-May-11 3:24 

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.