HMG_CallDLL()
 Calls a ANSI/Unicode DLL Function

 

 

 

HMG_CallDLL() detects the current code page and appropriately called the ANSI or Unicode version of the function.

 

 

Syntax:

 

 

      HMG_CallDLL ( cLibName, [ nRetType ] , cFuncName, FuncArg1, ..., FuncArgN ) ---> xRetValue

 

 

      nRetType: value type returned by the function (constants defined in hbdyn.ch)

 

            - HB_DYN_CTYPE_DEFAULT

            - HB_DYN_CTYPE_CHAR

            - HB_DYN_CTYPE_CHAR_UNSIGNED

            - HB_DYN_CTYPE_CHAR_PTR

            - HB_DYN_CTYPE_CHAR_UNSIGNED_PTR

            - HB_DYN_CTYPE_SHORT

            - HB_DYN_CTYPE_SHORT_UNSIGNED

            - HB_DYN_CTYPE_SHORT_PTR

            - HB_DYN_CTYPE_SHORT_UNSIGNED_PTR

            - HB_DYN_CTYPE_INT

            - HB_DYN_CTYPE_INT_UNSIGNED

            - HB_DYN_CTYPE_INT_PTR

            - HB_DYN_CTYPE_INT_UNSIGNED_PTR

            - HB_DYN_CTYPE_LONG

            - HB_DYN_CTYPE_LONG_UNSIGNED

            - HB_DYN_CTYPE_LONG_PTR

            - HB_DYN_CTYPE_LONG_UNSIGNED_PTR

            - HB_DYN_CTYPE_LLONG

            - HB_DYN_CTYPE_LLONG_UNSIGNED

            - HB_DYN_CTYPE_LLONG_PTR

            - HB_DYN_CTYPE_LLONG_UNSIGNED_PTR

            - HB_DYN_CTYPE_FLOAT

            - HB_DYN_CTYPE_FLOAT_PTR

            - HB_DYN_CTYPE_DOUBLE

            - HB_DYN_CTYPE_DOUBLE_PTR

            - HB_DYN_CTYPE_BOOL

            - HB_DYN_CTYPE_BOOL_PTR

            - HB_DYN_CTYPE_VOID

            - HB_DYN_CTYPE_VOID_PTR

            - HB_DYN_CTYPE_STRUCTURE

            - HB_DYN_CTYPE_STRUCTURE_PTR

 

 

 

Source example:

 

cBuffer := SPACE (1024)

nCopyCharacters := HMG_CallDLL ("USER32.DLL", HB_DYN_CTYPE_INT, "GetWindowText", Win_1.HANDLE, @cBuffer, 512)

MsgInfo (cBuffer)