Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to get USER ACCOUNT ID in windows?
-
I'm trying to get user account id in windows, but no success. I tried QProcess but isn't possible.
C# gives this in below code -
int sessionId = System.Diagnostics.Process.GetCurrentProcess().SessionId;Here is the screen shot of task manager which shows you the ID of user - https://hub.mangoapps.com/sf/ODE0MDRfMTMwMDg1Ng
Thanks in advance.
-
Here are some links that might help you
http://stackoverflow.com/questions/14034666/how-to-query-a-users-session-id-under-windows
https://msdn.microsoft.com/en-us/library/bb432286(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724953(v=vs.85).aspx
-
@matobodo Thanks! The links helped.
Get process id from GetCurrentProcessID() & ProcessIdToSessionId() gives you session id by inputting process id.
#include<windows.h> to access these methods.