Mike,
The Script BASIC IUP extension module is only one of the methods to incorporate IUP under Windows. My focus on the Windows front with IUP is with Charles's DLLC extension module. This method is using a FFI approach and exposes the the multi-threaded aspect of SB. Charles pulled another rabbit out of his hat and allowed IUP to run in a threaded model which by default is not thread safe. I think you would have much more fun with SB if you used the DLLC ext. module with IUP. DLLC also allows calling standard DLL functions as threads, low level COM and BSTR support. The icing on the cake is that the MT extension module works with DLLC allowing shared (lockable R/W) variables and session support between threads and the main script. This module was created by Peter Verhas for the sbhttpd application web server that runs as a service.
Here is the iupinc.sb file I'm using with with DLLC.
' IUP DLLC Interface
'DIAGNOSTICS
declare sub dllshow alias "dllshow" lib "DLLC"
declare sub dllreco alias "dllreco" lib "DLLC"
declare sub dllsecs alias "dllsecs" lib "DLLC"
'DLL LINKAGE
declare sub dllfile alias "dllfile" lib "DLLC"
declare sub dllproc alias "dllproc" lib "DLLC"
'DLL CALLS
declare sub dllmeth alias "dllmeth" lib "DLLC"
declare sub dllcall alias "dllcall" lib "DLLC"
declare sub dllcald alias "dllcald" lib "DLLC"
declare sub dllcalt alias "dllcalt" lib "DLLC"
declare sub dllcobj alias "dllcobj" lib "DLLC"
declare sub dllcobt alias "dllcobt" lib "DLLC"
declare sub dllclbk alias "dllclbk" lib "DLLC"
'SBCALLS
declare sub dllprog alias "dllprog" lib "dllc"
declare sub dllendp alias "dllendp" lib "dllc"
declare sub dlltran alias "dlltran" lib "DLLC"
declare sub dllclos alias "dllclos" lib "DLLC"
'DATA
declare sub dlltype alias "dlltype" lib "DLLC"
declare sub dlldimv alias "dlldimv" lib "DLLC"
declare sub dllfill alias "dllfill" lib "DLLC"
declare sub dllgetm alias "dllgetm" lib "DLLC"
declare sub dllputm alias "dllputm" lib "DLLC"
declare sub dllfrem alias "dllfrem" lib "DLLC"
'STRINGS / GUIDS
declare sub dlldelo alias "dlldelo" lib "DLLC"
declare sub dllostr alias "dllostr" lib "DLLC"
declare sub dllzstr alias "dllzstr" lib "DLLC"
declare sub dllastr alias "dllastr" lib "DLLC"
declare sub dllwstr alias "dllwstr" lib "DLLC"
declare sub dllcast alias "dllcast" lib "DLLC"
declare sub dllguid alias "dllguid" lib "DLLC"
iup = dllfile("iup.dll")
iupcontrols = dllfile("iupcontrols.dll")
iupimglib = dllfile("iupimglib.dll")
iupcd = dllfile("iupcd.dll")
cd = dllfile("cd.dll")
' **********************
' IUP System Functions *
' **********************
IupOpen = dllproc(iup,"IupOpen cdecl i = (i argc, i argv)")
IupClose = dllproc(iup,"IupClose cdecl ()")
IupVersion = dllproc(iup,"IupVersion cdecl c* = ()")
IupLoad = dllproc(iup,"IupLoad cdecl c* = (c *filename)")
IupLoadBuffer = dllproc(iup,"IupLoadBuffer cdecl c* = (c *buffer)")
IupSetLanguage = dllproc(iup,"IupSetLanguage cdecl = (c *lng)")
IupGetLanguage = dllproc(iup,"IupGetLanguage cdecl c* = ()")
' *************************
' IUP Attribute Functions *
' *************************
IupStoreAttribute = dllproc(iup,"IupStoreAttribute cdecl = (i ih, c *name, c *value)")
IupStoreAttributeId = dllproc(iup,"IupStoreAttributeId cdecl = (i ih, c *name, i id, c *value)")
IupSetAttribute = dllproc(iup,"IupSetAttribute cdecl = (i ih, c *name, c *value)")
IupSetAttributeId = dllproc(iup,"IupSetAttributeId cdecl = (i ih, c *name, i id, c *value)")
IupSetAttributes = dllproc(iup,"IupSetAttributes cdecl i = (i ih, c *nameval)")
IupResetAttribute = dllproc(iup,"IupResetAttribute cdecl = (i ih, c *name)")
IupSetAtt = dllproc(iup,"IupSetAtt cdecl i = (c *handle_name, i ih, c *name)")
IupSetAttributeHandle = dllproc(iup,"IupSetAttributeHandle cdecl = (i ih, c *name, i ih_named)")
IupGetAttributeHandle = dllproc(iup,"IupGetAttributeHandle cdecl i = (i ih, c *name)")
IupGetAttribute = dllproc(iup,"IupGetAttribute cdecl c* = (i ih, c *name)")
IupGetAttributeId = dllproc(iup,"IupGetAttributeId cdecl c* = (i ih, c *name, i id)")
IupGetAllAttributes = dllproc(iup,"IupGetAllAttributes cdecl i = (i ih, t *names, i max_n)")
IupGetAttributes = dllproc(iup,"IupGetAttributes cdecl c* = (i ih)")
IupGetFloat = dllproc(iup,"IupGetFloat cdecl f = (i ih, c *name)")
IupGetFloatId = dllproc(iup,"IupGetFloatId cdecl f = (i ih, c *name, i id)")
IupGetFloatId2 = dllproc(iup,"IupGetFloatId2 cdecl f = (i ih, c *name, i lin, i col)")
IupGetInt = dllproc(iup,"IupGetInt cdecl i = (i ih, c *name)")
IupGetInt2 = dllproc(iup,"IupGetInt2 cdecl i = (i ih, c *name)")
IupGetIntInt = dllproc(iup,"IupGetIntInt cdecl i = (i ih, c *name, i i1, i i2)")
IupGetIntId = dllproc(iup,"IupGetIntId cdecl i = (i ih, c *name, i id)")
IupGetIntId2 = dllproc(iup,"IupGetIntId2 cdecl i = (i ih, c *name, i lin, i col)")
IupStoreGlobal = dllproc(iup,"IupStoreGlobal cdecl = (c *name, c *value)")
IupSetGlobal = dllproc(iup,"IupSetGlobal cdecl = (c *name, c *value)")
IupGetGlobal = dllproc(iup,"IupGetGlobal cdecl c* = (c *name)")
' **********************
' IUP Event Functions *
' **********************
IupMainLoop = dllproc(iup,"IupMainLoop cdecl i = ()")
IupMainLoopLevel = dllproc(iup,"IupMainLoopLevel cdecl i = ()")
IupLoopStep = dllproc(iup,"IupLoopStep cdecl i = ()")
IupLoopStepWait = dllproc(iup,"IupLoopStepWait cdecl i = ()")
IupExitLoop = dllproc(iup,"IupExitLoop cdecl = ()")
IupFlush = dllproc(iup,"IupFlush cdecl = ()")
IupGetCallback = dllproc(iup,"IupGetCallback cdecl i = (i ih, c *name)")
IupSetCallback = dllproc(iup,"IupSetCallback cdecl i = (i ih, c *cb_name, i funcaddr)")
IupSetCallbacks = dllproc(iup,"IupSetCallbacks cdecl i = (i ih, c *name, i func)")
IupGetActionName = dllproc(iup,"IupGetActionName cdecl c* = ()")
IupSetFunction = dllproc(iup,"IupSetFunction cdecl i = (c *name, i func)")
IupRecordInput = dllproc(iup,"IupRecordInput cdecl i = (c *filename, i mode)")
IupPlayInput = dllproc(iup,"IupPlayInput cdecl i = (c *filename)")
' **********************
' IUP Layout Functions *
' **********************
IupCreate = dllproc(iup,"IupCreate cdecl i = (c *classname)")
' <?> Ihandle *IupCreatep(const char *classname, void* params0, ...)
IupDestroy = dllproc(iup,"IupDestroy cdecl = (i ih)")
IupMap = dllproc(iup,"IupMap cdecl i = (i ih)")
IupUnmap = dllproc(iup,"IupUnmap cdecl = (i ih)")
IupGetAllClasses = dllproc(iup,"IupGetAllClasses cdecl i = (t *names, i max_n)")
IupGetClassName = dllproc(iup,"IupGetClassName cdecl c* = (i ih)")
IupGetClassType = dllproc(iup,"IupGetClassType cdecl c* = (i ih)")
IupClassMatch = dllproc(iup,"IupClassMatch cdecl i = (i ih, c *classname)")
IupGetClassAttributes = dllproc(iup,"IupGetClassAttributes cdecl i = (c *classname, t *names, i max_n)")
IupGetClassCallbacks = dllproc(iup,"IupGetClassCallbacks cdecl i = (c *classname, t *names, i max_n)")
IupSaveClassAttributes = dllproc(iup,"IupSaveClassAttributes cdecl = (i ih)")
IupCopyClassAttributes = dllproc(iup,"IupCopyClassAttributes cdecl = (i src_ih, i dst_ih)")
IupSetClassDefaultAttribute = dllproc(iup,"IupSetClassDefaultAttribute cdecl = (c *classname, c *name, c *value)")
IupFill = dllproc(iup,"IupFill cdecl i = ()")
IupHbox = dllproc(iup,"IupHbox cdecl i = (i child)")
IupVbox = dllproc(iup,"IupVbox cdecl i = (i child)")
IupZbox = dllproc(iup,"IupZbox cdecl i = (i child)")
IupRadio = dllproc(iup,"IupRadio cdecl i = (i child)")
IupNormalizer = dllproc(iup,"IupNormalizer cdecl i = (i ih_first)")
IupCbox = dllproc(iup,"IupCbox cdecl i = (i child)")
IupSbox = dllproc(iup,"IupSbox cdecl i = (i child)")
IupSplit = dllproc(iup,"IupSplit cdecl i = (i child1, i child2)")
IupAppend = dllproc(iup,"IupAppend cdecl i = (i ih, i new_child)")
IupDetach = dllproc(iup,"IupDetach cdecl = (i child)")
IupInsert = dllproc(iup,"IupInsert cdecl i = (i ih, i ref_child, i new_child)")
IupReparent = dllproc(iup,"IupReparent cdecl i = (i child, i new_parent, i ref_child)")
IupGetParent = dllproc(iup,"IupGetParent cdecl i = (i ih)")
IupGetChild = dllproc(iup,"IupGetChild cdecl i = (i ih, i pos)")
IupGetChildPos = dllproc(iup,"IupGetChildPos cdecl i = (i ih, i child)")
IupGetChildCount = dllproc(iup,"IupGetChildCount cdecl i = (i ih)")
IupGetNextChild = dllproc(iup,"IupGetNextChild cdecl i = (i ih, i child)")
IupGetBrother = dllproc(iup,"IupGetBrother cdecl i = (i ih)")
IupGetDialog = dllproc(iup,"IupGetDialog cdecl i = (i ih)")
IupGetDialogChild = dllproc(iup,"IupGetDialogChild cdecl i = (i ih, c *name)")
IupRefresh = dllproc(iup,"IupRefresh cdecl = (i ih)")
IupRefreshChildren = dllproc(iup,"IupRefreshChildren cdecl = (i ih)")
IupUpdate = dllproc(iup,"IupUpdate cdecl = (i ih)")
IupUpdateChildren = dllproc(iup,"IupUpdateChildren cdecl = (i ih)")
IupRedraw = dllproc(iup,"IupRedraw cdecl = (i ih, i children)")
IupConvertXYToPos = dllproc(iup,"IupConvertXYToPos cdecl i = (i ih, i x, i y)")
' **********************
' IUP Dialog Functions *
' **********************
IupDialog = dllproc(iup,"IupDialog cdecl i = (i child)")
IupPopup = dllproc(iup,"IupPopup cdecl i = (i ih, i x i y)")
IupShow = dllproc(iup,"IupShow cdecl i = (i ih)")
IupShowXY = dllproc(iup,"IupShowXY cdecl i = (i ih, i x i y)")
IupHide = dllproc(iup,"IupHide cdecl i = (i ih)")
IupFileDlg = dllproc(iup,"IupFileDlg cdecl i = ()")
IupMessageDlg = dllproc(iup,"IupMessageDlg cdecl i = ()")
IupColorDlg = dllproc(iup,"IupColorDlg cdecl i = ()")
IupFontDlg = dllproc(iup,"IupFontDlg cdecl i = ()")
IupAlarm = dllproc(iup,"IupAlarm cdecl i = (c *t, c *m, c *b1, c *b2, c *b3)")
IupGetFile = dllproc(iup,"IupGetFile cdecl i = (c *filename)")
IupGetColor = dllproc(iup,"IupGetColor cdecl i = (i x, i y, i *r, i *g, i *b)")
' <?> IupGetParam = dllproc(iup,"IupGetParam cdecl i = (c *title, i action, void* user_data, c *format)")
' <?> int IupGetParam(const char* title, Iparamcb action, void* user_data, const char* format,...)
IupGetText = dllproc(iup,"IupGetText cdecl i = (c *title, c *text)")
IupListDialog = dllproc(iup,"IupListDialog cdecl i = (i type, c *title, i size, t *list, i op, i max_col, i max_lin, i marks)")
IupMessage = dllproc(iup,"IupMessage cdecl = (c *title, c *message)")
IupLayoutDialog = dllproc(iup,"IupLayoutDialog cdecl i = (1 dialog)")
IupElementPropertiesDialog = dllproc(iup,"IupElementPropertiesDialog cdecl i = (i elem)")
' ***********************
' IUP Control Functions *
' ***********************
IupButton = dllproc(iup,"IupButton cdecl i = (c *title, c *action)")
IupCanvas = dllproc(iup,"IupCanvas cdecl i = (c *action)")
IupFrame = dllproc(iup,"IupFrame cdecl i = (i child)")
IupLabel = dllproc(iup,"IupLabel cdecl i = (c *title)")
IupList = dllproc(iup,"IupList cdecl i = (c *action)")
IupMultiLine = dllproc(iup,"IupMultiLine cdecl i = (c *action)")
IupProgressBar = dllproc(iup,"IupProgressBar cdecl i = ()")
' IupGauge = dllproc(iup,"IupGauge cdecl i = ()")
IupSpin = dllproc(iup,"IupSpin cdecl i = ()")
IupTabs = dllproc(iup,"IupTabs cdecl i = (i child)")
IupTabsv = dllproc(iup,"IupTabsv cdecl i = (t *children)")
IupText = dllproc(iup,"IupText cdecl i = (c *action)")
IupToggle = dllproc(iup,"IupToggle cdecl i = (c *title, c *action)")
IupTree = dllproc(iup,"IupTree cdecl i = ()")
IupVal = dllproc(iup,"IupVal cdecl i = (c *orientation)")
' ************************
' IUP Resource Functions *
' ************************
IupImage = dllproc(iup,"IupImage cdecl i = (i width, i height, c *pixels)")
IupImageRGB = dllproc(iup,"IupImageRGB cdecl i = (i width, i height, c *pixels)")
IupImageRGBA = dllproc(iup,"IupImageRGBA cdecl i = (i width, i height, c *pixels)")
IupNextField = dllproc(iup,"IupNextField cdecl i = (i ih)")
IupPreviousField = dllproc(iup,"IupPreviousField cdecl i = (i ih)")
IupGetFocus = dllproc(iup,"IupGetFocus cdecl i = ()")
IupSetFocus = dllproc(iup,"IupSetFocus cdecl i = (i ih)")
IupItem = dllproc(iup,"IupItem cdecl i = (c *title, c *action)")
IupMenu = dllproc(iup,"IupMenu cdecl i = (i child)")
IupMenuv = dllproc(iup,"IupMenuv cdecl i = (t *children)")
IupSeparator = dllproc(iup,"IupSeparator cdecl i = ()")
IupSubmenu = dllproc(iup,"IupSubmenu cdecl i = (c *title, i menu)")
IupSetHandle = dllproc(iup,"IupSetHandle cdecl i = (c *name, i ih)")
IupGetHandle = dllproc(iup,"IupGetHandle cdecl i = (c *name)")
IupGetName = dllproc(iup,"IupGetName cdecl c* = (i ih)")
IupGetAllNames = dllproc(iup,"IupGetAllNames cdecl i = (t *names, i max_n)")
IupGetAllDialogs = dllproc(iup,"IupGetAllDialogs cdecl i = (t *names, i max_n)")
IupClipboard = dllproc(iup,"IupClipboard cdecl i = ()")
IupTimer = dllproc(iup,"IupTimer cdecl i = ()")
IupUser = dllproc(iup,"IupUser cdecl i = ()")
IupHelp = dllproc(iup,"IupHelp cdecl i = (c *url)")
' **************
' IUP Controls *
' **************
IupControlsOpen = dllproc(iupcontrols,"IupControlsOpen cdecl i = ()")
IupMatrix = dllproc(iupcontrols,"IupMatrix cdecl i = (c *action)")
IupImageLibOpen = dllproc(iupimglib,"IupImageLibOpen cdecl = ()")
' IUP Global Constants
GLOBAL CONST NUL = 0X0
' **********************
' Common Return Values *
' **********************
GLOBAL CONST IUP_ERROR = 1
GLOBAL CONST IUP_NOERROR = 0
GLOBAL CONST IUP_OPENED = -1
GLOBAL CONST IUP_INVALID = -1
' ************************
' Callback Return Values *
' ************************
GLOBAL CONST IUP_IGNORE = -1
GLOBAL CONST IUP_DEFAULT = -2
GLOBAL CONST IUP_CLOSE = -3
GLOBAL CONST IUP_CONTINUE = -4
' *****************************************
' IupPopup and IupShowXY Parameter Values *
' *****************************************
GLOBAL CONST IUP_CENTER = 0xFFFF
GLOBAL CONST IUP_LEFT = 0xFFFE
GLOBAL CONST IUP_RIGHT = 0xFFFD
GLOBAL CONST IUP_MOUSEPOS = 0xFFFC
GLOBAL CONST IUP_CURRENT = 0xFFFB
GLOBAL CONST IUP_CENTERPARENT = 0xFFFA
GLOBAL CONST IUP_TOP = 0xFFFE
GLOBAL CONST IUP_BOTTOM = 0xFFFD
FUNCTION SB_CreateImg(text)
LOCAL i, strip, array, binstr
strip = " " & CHR(9) & CHR(10) & CHR(13)
FOR i = 1 TO LEN(strip)
text = REPLACE(text, MID(strip, i, 1), "")
NEXT i
SPLITA text BY "," TO array
FOR i = 0 TO UBOUND(array)
binstr &= CHR(array[i])
NEXT i
SB_CreateImg = binstr
END FUNCTION
Note: DLLC is a OxygenBasic extension module for Script BASIC. You will find the current source in the ProjectB\ScriptBasic directory of the O2 WIP ZIP. (wizard offering)