#include<windows.h>
#include<iostream.h>
....
......
char Buffer[_MAX_PATH];// you can choose any other size that feet
HINSTANCE hInstance = GetModuleHandle(NULL);
GetModuleFileName(hInstance, Buffer, MAX_PATH);
cout<< "This program is: "<<Buffer<<endl; // you can also use a 'MessageBox' to display this
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.