In Native C++, how can I get the current process Name and date time. I am not a C++ programmer.
In C#, it is very trivial to do it like this:
Process name:
Process.GetCurrentProcess().ProcessName
Date Time:
DateTime.Now.ToString("yyyy-MM-dd_HH.mm.ss.ff")
How can they be retrieved in C++ native?
To get the name of the current process you can use
GetModuleFileName():You can then extract the part of
exe_pathafter the last\character.To get the current time, you can use
std::time().