argv[0] For Winmain?

Is it possible to obtain argv[0] information (program full path and name) using a win32 compiler such as Borland c++ 5?
Winmain's lpCmdParam argument does not contain this info.

Thanks.
1agallenAsked:
Who is Participating?
 
papirusConnect With a Mentor Commented:
Use Win32API Function :

GetModuleFileName()
//if you have problem getting HMODULE - use GetModuleHandle() with NULL as the first parameter
0
 
BudVVeezerCommented:
If you want to get all of the arguments, you can use GetCommandLine()  This returns a string, which is the full command line, path, file and args included.

~Aaron
0
 
NickRepinCommented:
The easiest way for Borland compiler is to use _argc and _argv global variables. They are fully identical main(int argc,char* argv[]). They are work for GUI and console.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.