Click here to Skip to main content
15,912,069 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Measuring the thread running duration. Pin
Roger Stoltz27-Nov-08 10:23
Roger Stoltz27-Nov-08 10:23 
GeneralRe: Measuring the thread running duration. Pin
Ahmed Charfeddine27-Nov-08 11:01
Ahmed Charfeddine27-Nov-08 11:01 
QuestionRe: Measuring the thread running duration. Pin
Roger Stoltz27-Nov-08 11:37
Roger Stoltz27-Nov-08 11:37 
AnswerRe: Measuring the thread running duration. Pin
Ahmed Charfeddine27-Nov-08 12:00
Ahmed Charfeddine27-Nov-08 12:00 
GeneralRe: Measuring the thread running duration. Pin
Roger Stoltz27-Nov-08 12:12
Roger Stoltz27-Nov-08 12:12 
AnswerRe: Measuring the thread running duration. [modified] Pin
akirilov24-Nov-08 4:28
akirilov24-Nov-08 4:28 
AnswerRe: Measuring the thread running duration. Pin
Roger Stoltz24-Nov-08 5:08
Roger Stoltz24-Nov-08 5:08 
QuestionHow to check if running under administrator account on Vista from MFC app? Pin
mkoroudjiev24-Nov-08 1:58
mkoroudjiev24-Nov-08 1:58 
Hello,
I used the following procedure to find if the app is running under administrator account on XP:

IsUserAdmin()
{
	BOOL b;
	SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
	PSID AdministratorsGroup;

	b = AllocateAndInitializeSid(
		&NtAuthority,
		2,
		SECURITY_BUILTIN_DOMAIN_RID,
		DOMAIN_ALIAS_RID_ADMINS,
		0, 0, 0, 0, 0, 0,
		&AdministratorsGroup); 
	if(b) 
	{
		if (!CheckTokenMembership(NULL, AdministratorsGroup, &b)) 
		{
			b = FALSE;
		}
		FreeSid(AdministratorsGroup);
	}
	return(b);
}


The problem is that it will always return FALSE when running on Vista even if the account is with administrator's rights. That's because of the UAC, I guess. But how to check the real account type?
Thank you.
AnswerRe: How to check if running under administrator account on Vista from MFC app? Pin
Mark Salsbery24-Nov-08 6:28
Mark Salsbery24-Nov-08 6:28 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
mkoroudjiev24-Nov-08 7:55
mkoroudjiev24-Nov-08 7:55 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
Mark Salsbery24-Nov-08 10:54
Mark Salsbery24-Nov-08 10:54 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
mkoroudjiev24-Nov-08 18:50
mkoroudjiev24-Nov-08 18:50 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
Mark Salsbery25-Nov-08 7:04
Mark Salsbery25-Nov-08 7:04 
Questioninstallation path Pin
NewVC++24-Nov-08 1:03
NewVC++24-Nov-08 1:03 
AnswerRe: installation path Pin
_AnsHUMAN_ 24-Nov-08 1:38
_AnsHUMAN_ 24-Nov-08 1:38 
AnswerRe: installation path Pin
krmed24-Nov-08 3:25
krmed24-Nov-08 3:25 
AnswerRe: installation path Pin
Jijo.Raj24-Nov-08 6:44
Jijo.Raj24-Nov-08 6:44 
QuestionListview item Pin
ashishmax4724-Nov-08 0:32
ashishmax4724-Nov-08 0:32 
AnswerRe: Listview item Pin
_AnsHUMAN_ 24-Nov-08 0:56
_AnsHUMAN_ 24-Nov-08 0:56 
GeneralRe: Listview item Pin
ashishmax4724-Nov-08 1:24
ashishmax4724-Nov-08 1:24 
GeneralRe: Listview item Pin
_AnsHUMAN_ 24-Nov-08 1:31
_AnsHUMAN_ 24-Nov-08 1:31 
GeneralRe: Listview item Pin
ashishmax4724-Nov-08 1:42
ashishmax4724-Nov-08 1:42 
GeneralRe: Listview item Pin
_AnsHUMAN_ 24-Nov-08 1:52
_AnsHUMAN_ 24-Nov-08 1:52 
GeneralRe: Listview item Pin
ashishmax4724-Nov-08 2:01
ashishmax4724-Nov-08 2:01 
GeneralRe: Listview item Pin
_AnsHUMAN_ 24-Nov-08 17:28
_AnsHUMAN_ 24-Nov-08 17:28 

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.