|
|||
|
Hello!
I want to use winAPI funcs. For example: Code:
struct {
long left;
long top;
long right;
long bottom;
} RECT;
dllimport "user32.dll" stdcall int GetWindowRect(long, RECT*) as user32_GetWindowRect;
var winID = getMainWnd().handle;
var myRect = new Struct(RECT);
var a = user32_GetWindowRect(winID, newRect);
trace('a='+a);
trace("myRect.left="+myRect.left);
trace("myRect.top="+myRect.top);
trace("myRect.right="+myRect.right);
trace("myRect.bottom="+myRect.left);
We tried many various vays: with StringStream, pointers, pointers-to-structure - cant make it work. Thx in advance.
__________________
#define true false //happy debugging, friends |
|
|||
|
Code:
struct {
long left;
long top;
long right;
long bottom;
} RECT;
dllimport "user32.dll" stdcall int GetWindowRect(long, RECT*) as user32_GetWindowRect;
var winID = getMainWnd().handle;
var myRect = new Struct(RECT);
var o = new Object;
o.value = myRect;
var a = user32_GetWindowRect(winID, o);
myRect = o.value;
trace('a='+a);
trace("myRect.left="+myRect.left);
trace("myRect.top="+myRect.top);
trace("myRect.right="+myRect.right);
trace("myRect.bottom="+myRect.left);
Whenever you want to receive output data of a parameter of a Dll function, please use an object that contains a "value" property, which will contain the input value and will receive the output value. |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|