Click here to Skip to main content
15,892,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to know if there is a valid session running on the machine or not ? Pin
Covean27-Oct-09 23:56
Covean27-Oct-09 23:56 
QuestionRe: How to know if there is a valid session running on the machine or not ? Pin
Kushagra Tiwari27-Oct-09 23:55
Kushagra Tiwari27-Oct-09 23:55 
AnswerRe: How to know if there is a valid session running on the machine or not ? Pin
Covean28-Oct-09 0:04
Covean28-Oct-09 0:04 
QuestionRe: How to know if there is a valid session running on the machine or not ? Pin
Randor 28-Oct-09 0:25
professional Randor 28-Oct-09 0:25 
AnswerRe: How to know if there is a valid session running on the machine or not ? Pin
Covean28-Oct-09 0:40
Covean28-Oct-09 0:40 
GeneralRe: How to know if there is a valid session running on the machine or not ? Pin
Kushagra Tiwari28-Oct-09 0:26
Kushagra Tiwari28-Oct-09 0:26 
AnswerRe: How to know if there is a valid session running on the machine or not ? Pin
Randor 28-Oct-09 0:32
professional Randor 28-Oct-09 0:32 
AnswerRe: How to know if there is a valid session running on the machine or not ? Pin
Kushagra Tiwari28-Oct-09 4:34
Kushagra Tiwari28-Oct-09 4:34 
Finally figured it how it has to be done :

Posting my anwer here :

#include <windows.h>
#include <stdio.h>

// The following constant may be defined by including NtStatus.h.
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)

// The LSA authentication functions are available in Unicode only.
#define UNICODE

int _cdecl main()
{
PLUID sessions;
ULONG count;
NTSTATUS retval;
int i;

retval = LsaEnumerateLogonSessions(&count, &sessions);

if (retval != STATUS_SUCCESS) {
wprintf (L"LsaEnumerate failed %lu\n",
LsaNtStatusToWinError(retval));
return 1;
}
wprintf (L"Enumerate sessions received %lu sessions.\n", count);

// Process the array of session LUIDs...
for (i =0;i < (int) count; i++) {
GetSessionData (&sessions[i]);
}

// Free the array of session LUIDs allocated by the LSA.
LsaFreeReturnBuffer(sessions);
return 0;
}

it works ffine...SOme body please mark this answer and close the threda as I cant Smile | :)

Kushagra
Questionhow to get the file or folder name which is selected by mouse Pin
Member 211485227-Oct-09 23:07
Member 211485227-Oct-09 23:07 
AnswerRe: how to get the file or folder name which is selected by mouse Pin
Richard MacCutchan27-Oct-09 23:24
mveRichard MacCutchan27-Oct-09 23:24 
AnswerRe: how to get the file or folder name which is selected by mouse Pin
Adam Roderick J28-Oct-09 0:19
Adam Roderick J28-Oct-09 0:19 
QuestionRe: how to get the file or folder name which is selected by mouse Pin
Randor 28-Oct-09 0:50
professional Randor 28-Oct-09 0:50 
AnswerRe: how to get the file or folder name which is selected by mouse Pin
Member 211485228-Oct-09 0:52
Member 211485228-Oct-09 0:52 
GeneralRe: how to get the file or folder name which is selected by mouse Pin
Randor 28-Oct-09 0:59
professional Randor 28-Oct-09 0:59 
QuestionName that pattern or patterns... Pin
alex.barylski27-Oct-09 21:12
alex.barylski27-Oct-09 21:12 
AnswerRe: Name that pattern or patterns... Pin
Randor 27-Oct-09 22:18
professional Randor 27-Oct-09 22:18 
GeneralRe: Name that pattern or patterns... Pin
alex.barylski28-Oct-09 5:09
alex.barylski28-Oct-09 5:09 
GeneralRe: Name that pattern or patterns... Pin
Randor 28-Oct-09 6:12
professional Randor 28-Oct-09 6:12 
GeneralRe: Name that pattern or patterns... Pin
alex.barylski28-Oct-09 6:42
alex.barylski28-Oct-09 6:42 
QuestionDisabling Restore button of a window Pin
Deepu Antony27-Oct-09 20:06
Deepu Antony27-Oct-09 20:06 
AnswerRe: Disabling Restore button of a window Pin
Randor 27-Oct-09 20:27
professional Randor 27-Oct-09 20:27 
GeneralDisabling Restore option(Minimize,Maximize ,Close) of a window Pin
Deepu Antony27-Oct-09 20:43
Deepu Antony27-Oct-09 20:43 
GeneralRe: Disabling Restore option(Minimize,Maximize ,Close) of a window Pin
Randor 27-Oct-09 21:53
professional Randor 27-Oct-09 21:53 
GeneralRe: Disabling Restore option(Minimize,Maximize ,Close) of a window Pin
Deepu Antony27-Oct-09 23:43
Deepu Antony27-Oct-09 23:43 
GeneralRe: Disabling Restore option(Minimize,Maximize ,Close) of a window Pin
Randor 28-Oct-09 6:18
professional Randor 28-Oct-09 6:18 

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.