I'm converting from C++ to js-ctypes, and came across this function that is not documented by the guy.
fillchar
It's not on msdn either. Any ideas on what it's doing?
var aButton:TTBBUTTON;
//Check if there's another button after this one.
fillchar(aButton,sizeof(aButton),0);
rez:=CallWindowProc(OldWndProc,hToolbar,TB_GETBUTTON,ButtonIndex+1,integer(@aButton));
HaveBehind:=(rez<>0) and (not HasFlag(aButton.fsStyle,BTNS_DROPDOWN));
in js-ctypes aButton
is this:
var aButton = new struct_TBButton();
var struct_TBButton;
if (ctypes.voidptr_t.size == 4 /* 32-bit */ ) {
struct_TBButton = ctypes.StructType('TBButton', [
{'iBitmap': ctypes.int},
{'idCommand': ctypes.int},
{'fbState': ctypes.unsigned_char},
{'fsStyle': ctypes.unsigned_char},
{'bReserved': ctypes.unsigned_char},
{'bReserved2': ctypes.unsigned_char},
{'dwData': ctypes.uintptr_t},
{'iString': ctypes.intptr_t}
]);
} else { /* 64-bit */
struct_TBButton = ctypes.StructType('TBButton', [
{'iBitmap': ctypes.int},
{'idCommand': ctypes.int},
{'fbState': ctypes.unsigned_char},
{'fsStyle': ctypes.unsigned_char},
{'bReserved': ctypes.unsigned_char},
{'bReserved2': ctypes.unsigned_char},
{'bReserved3': ctypes.unsigned_char},
{'bReserved4': ctypes.unsigned_char},
{'bReserved5': ctypes.unsigned_char},
{'bReserved6': ctypes.unsigned_char},
{'dwData': ctypes.uintptr_t},
{'iString': ctypes.intptr_t}
]);
}