|
|||
|
hello,
I want pilot a button of an other application. I now how find my button like a Window Object: Code:
var ws = Window.find("#32770","Nikon Capture Camera Control");
//for (var i = 0; i < ws.length; i++)
// {
trace("caption: "+ws.caption);
trace("handle: "+ws.handle );
trace("className:"+ws.className );
trace("*************************************************************************");
// }
ws.bringToTop();
trace ("xxxxxxxxxxxxxxxxxxxxxxxxxxCHILDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
var wchild= ws.getChildren();
for (var i = 0; i < wchild.length; i++)
{
trace("caption: "+wchild[i].caption);
trace("handle: "+wchild[i].handle );
trace("className:"+wchild[i].className );
trace("*************************************************************************");
if (wchild[i].caption=="Download Options...")
{DO_Btn=wchild[i];}
}
but I search how click or do like... in fact I want pilot another application with swfKit... I hope it's possible. thanks Kado ps: sorry for my english :-[ :-\ ;D |
|
|||
|
Please try to send a mouse message to the button:
Code:
function MakeLong(x, y)
{
return x | (y << 16);
}
Application.sendMessage(Do_Btn.handle,
0x201/*WM_LBUTTONDOWN*/,
1/*MK_LBUTTON*/,
MakeLong(Do_Btn.left + 1, Do_Btn.top + 1));
|
|
|||
|
I add that (for the release):
Code:
Application.sendMessage(Do_Btn.handle,0x202/*WM_LBUTTONUP*/,1/*MK_LBUTTON*/,MakeLong(Do_Btn.left + 1, Do_Btn.top + 1)); |
|
|||
|
I have done an exemple with the Display Properties of Windows XP.
http://adonnoh.free.fr/swfkit/pilotApp.rar I try to click the cancel button....you can see, it's don't work. (be careful: you have to change 2 vars in the begining for the english version of XP.) thank for the help... ;D Kado |
|
|||
|
You would have to develop a dll by yourself to launch the program by using the "CreateProcess" function, and by using the "WaitForInputIdle" function you can wait for the program to be ready. All these two functions are windows functions.
|
|
|||
|
I don't know how make a dll, I don't know the C++, but it's not important, thanks for all... ;D
Kado french touch http://adonnoh.free.fr |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|