Hi, I want to print in the console the name of the exe that is executed (It prints his name). There is something I can do for read it?
thanx
Hi, I want to print in the console the name of the exe that is executed (It prints his name). There is something I can do for read it?
thanx
This forum is the best one I've ever seen. Great ppl, great coders
You can use command line arguments.
Code:int main(int argc, char **argv) { printf("Program Executed = %s\n", argv[0]); return 0; }
too bad I cant use int main, but I have to use WINAPI WinMain and the command line argument is only one lpCmdLine and no exe name in it...
This forum is the best one I've ever seen. Great ppl, great coders
Must be a windows question then
This question has been answered before on the windows board, try a search
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
thanx, I will search it (again and better)
This forum is the best one I've ever seen. Great ppl, great coders
Code:#include <windows.h> #include <iostream> int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) { MessageBox(HWND_DESKTOP,GetCommandLine(),0,MB_OK); return 0; }
really thanx
This forum is the best one I've ever seen. Great ppl, great coders