FreeBASIC  0.91.0
sys_getexename.c
Go to the documentation of this file.
1 /* get the executable's name */
2 
3 #include "../fb.h"
4 #include <windows.h>
5 
6 char *fb_hGetExeName( char *dst, ssize_t maxlen )
7 {
8  GetModuleFileName( GetModuleHandle( NULL ), dst, maxlen );
9 
10  char *p = strrchr( dst, '\\' );
11  if( p != NULL )
12  ++p;
13  else
14  p = dst;
15 
16  return p;
17 }