Dave's Brain

Browse - programming tips - win32 get name of the current program

Date: 2008jun10
Language: C/C++
Platform: win32

Q.  How do I get the name of the current program?

A.  Use GetModuleFileName with NULL as the first parameter.
For example:

	char	szMe[MAX_PATH];

	GetModuleFileName(NULL, szMe, sizeof(szMe));
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: