New hb_StartApp() added
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user