These might be what you looking for:
#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