New hb_StartApp() added

This commit is contained in:
Antonio Linares
2001-12-22 10:21:37 +00:00
parent b453267307
commit 64ca22a4f2

View File

@@ -61,6 +61,10 @@
#include "hbstack.h"
#include "hbvm.h"
#if defined(HB_OS_WIN_32)
extern HMODULE _hInstance;
#endif
HB_FUNC( LIBLOAD )
{
#if defined(HB_OS_WIN_32)
@@ -113,3 +117,21 @@ HB_FUNC( HB_LIBDO )
}
}
/* It returns TRUE if this function is called from the main app (EXE)
* and FALSE if it is called from a dynamic library (DLL)
* -please update the mentioned extensions for other OS-
*/
BOOL hb_StartApp( void )
{
#if defined(HB_OS_WIN_32)
{
return ( BOOL ) ( _hInstance == GetModuleHandle( NULL ) );
}
#else
{
return TRUE; /* Warning: this must be changed for other OS */
}
#endif
}