|
|||
|
Hi,
I am trying to register the user32 method GetCursorPos. According to MSDN GetCursorPos returns a 0 if it fails, and I can't get it to return anything other than a 0. Here is my code: function Point() { this.x = new Number; this.y = new Number; } var MyStructType = new DllParam(8, 1); var j = Dll.registerFunction("user32.dll", "GetCursorPos", "GetCursorPos", "bool", MyStructType); test = new Point(); var jj = GetCursorPos(test) Dialogs.msgBox(jj); ------ jj is 0 unless i pass the DllParam by value. This however, still does not set the x/y values. Also, MSDN doc says that the struct needs to be passed by ref so that is not even an option. PLEASE HELP! |
|
|||
|
Code:
var MyStructType = new DllParam(8, 1);
var j = Dll.registerFunction("user32.dll", "GetCursorPos", "GetCursorPos",
"stdcall", "bool", MyStructType);
// the parameter of GetCursorPos must be a StringStream
// that contains 8 bytes
function myParam()
{
this.value = new StringStream;
for (var i = 0; i < 8; i++) this.value.put(0);
function x()
{
this.value.getPos = 0;
return this.value.getLong();
}
function y()
{
this.value.getPos = 4;
return this.value.getLong();
}
}
var test = new myParam;
var jj = GetCursorPos(test);
trace("x: ", test.x());
trace("y: ", test.y());
|
|
|||
|
Thank you very much. SWFKIT is an awsome tool, and well worth the 299 price of admition.
And this should show all how great the support is for it. Same day response! Thanks again, and I'll be sure to spread the word! One more question. Is the next version of swfkit going to include standard OOP grammer? I really feel that once that is implemented the limits will be endless for this sweet little app! |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|