The new DLL has been posted. http://home.comcast.net/~habullock/habobjects.htm
The online docs have not yet been updated. I have one API call working in the code below. The second example was an attempt to use Chris' cursor control but I can not get it to work. The third example 'GetTempPath' return the length of the TEMP path but does not replace the value of $buffer. I think this may be a limitation of KiXtart. I tested with 4.50.
Code:
break on
$iRC=SETOPTION('WrapAtEOL','on')
$HABObject = createobject("HBullock.AdminObjects")
if vartypename($HABObject) <> "Object"
? "@serror"
endif
;Docs:
;
;You need to pass 4 parameters:
; 1. The name of the library from which you want to import the function.
; 2. The name of the function (as exported by the library).
; 3. The number and types of the arguments the function expects as input.
; 4. The type of the value returned by the function.
;
;Parameters 3 and 4 follow:
; I: value is an integer (int)
; N: value is a number (long)
; F: value is a floating point number (float)
; D: value is a double precision number (double)
; C: value is a char (char)
; P: value is a pointer (to a string, structure, etc)
;
;Parameter 4 could also be V for void
;
;$GetProcessID = $HABObject.Win32API ("kernel32", "GetCurrentProcessId", "", "I" )
; kernel32 is name of library
; GetCurrentProcessId is name of function
; There are no input paramters
; The function returns an integer
;This works great.
------------------
$GetProcessID = $HABObject.Win32API ("kernel32", "GetCurrentProcessId", "", "I" )
? vartypename($GetProcessID)
$pid = $GetProcessID.Call
? "pid = " + $pid
?
;This does nothing that I can see. Maybe the values are wrong.
;
;------------------------------------------------------------
$LoadCursorA=$HABObject.Win32API("USER32.DLL", "LoadCursor", "IN", "P")
; there are 2 input parameters ("IN" Integer and Long)
; returns a pointer This might be a problem in KiXtart but the next line shows an object
? "Handle = " + vartypename($LoadCursorA)
$SetCursor=$HABObject.Win32API("USER32.DLL", "SetSystemCursor", "PN", "N")
? "SetCursor = " + vartypename($SetCursor)
$CursorHandle = $LoadCursorA.Call(0, 32514)
$result = $SetCursor.Call( $CursorHandle, 32512)
? @Serror
sleep 5
$CursorHandle = $LoadCursorA.Call(0, 32514)
$result = $SetCursor.Call( $CursorHandle, 32512)
? @serror
; this does not appear to work because $buffer should behave as a pointer.
; but the function does not replace the content of $buffer
--------------------------------------------------------------------------
$GetTempPath = $HABObject.Win32API('kernel32', 'GetTempPath', 'NP', 'N')
for $x=1 to 80
$buffer = " " + $buffer
next
$result = $GetTempPath.Call(80, $buffer)
? "result = " + $result
? "buffer = (" + len($buffer)+ ") " + $buffer