display2008 Posted August 15, 2008 Share Posted August 15, 2008 Hi, My application only responds to MouseClick, but not ControlClick (I tried all the controlenable, focus, etc.). That's why I'd like to calculate Mouse Position from ControlClick Coords. I tried: window position + control position + ControlClick Coords but they don't add up to Mouse position. anyone has any idea? Thanks. >>>> Window <<<< Title: application Class: ThunderRT6MDIForm Position: 0, 0 Size: 1024, 256 Style: 0x16CF0000 ExStyle: 0x00040100 Handle: 0x00090606 >>>> Control <<<< Class: TreeView20WndClass Instance: 1 ClassnameNN: TreeView20WndClass1 Advanced (Class): [CLASS:TreeView20WndClass; INSTANCE:1] ID: Text: Position: 6, 58 Size: 125, 638 ControlClick Coords: 61, 57 Style: 0x56000203 ExStyle: 0x00000200 Handle: 0x001409FE >>>> Mouse <<<< Position: 71, 157 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< Link to comment Share on other sites More sharing options...
Andreik Posted August 15, 2008 Share Posted August 15, 2008 (edited) Try this: ControlClick ( "application", "", "[CLASSNN:TreeView20WndClass1]") Edited August 15, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
display2008 Posted August 18, 2008 Author Share Posted August 18, 2008 thanks for the reply, but no luck.. (i also tried the controltreeview as well...) it seems the application only works well w/ mouse click and that's why it'd be great if someone knows how to Calculate Mouse Position from ControlClick Coords Link to comment Share on other sites More sharing options...
Aceguy Posted August 18, 2008 Share Posted August 18, 2008 (edited) opt("MouseCoordMode",1) #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 445, 193, 125) $Button1 = GUICtrlCreateButton("Button1", 208, 112, 137, 65, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### sleep(5000) $pos=ControlGetPos("Form1","",$Button1) $win=WinGetPos("Form1") MouseClick("left",$win[0]+$pos[0]+($pos[2]/2),$win[1]+$pos[1]+($pos[3]/2)+10,1) sleep(5000) Exit this probably isnt what you want, but...... well ..... worth a try Edited August 19, 2008 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now