I need to simulate the mouse over a window of another application. I mean to trigger Mouse Move event... When I manually move the mouse over that specific window another window appears. I can determine the handle of that specific window, I know its X and Y, Top and Bottom positions and I can set the mouse cursor exactly over the area where it should be moved but I CAN NOT MOVE IT...
The code I use is VBA for Corel X5 that's why do not post it here... I try to pragmatically insert a new menu. I was able to do:
' Find main window handle using FindWindow(vbNullString, AppTitle), AppTitle = "CorelDRAW X5 - [" & ActiveDocument.FilePath & ActiveDocument.Name & "]"
' Find menu handle allocated dynamically but having the parent window handle (obtained using Spy++). Menu handle using FindWindowEx
' Simulate mouse right click SendMessage(Menu, BM_CLICK, 0, 0) for Press and SendMessage(Menu, RBM_UP, 0, 0) for Up .
' The window which appears at mouse right click receives a dynamic handle but respecting some rule for its class. Based on that I am able to obtain its handle. Based on that I am able to put mouse cursor on it (using SetCursorPos).
Now I need to move the mouse cursor over that window in order to trigger the Mouse Move event. Can anybody guide me in the right direction? Until now I tried 'mouse-event' API but I think is something which I do wrong and mouse cursor goes in the upper left corner of the screen...
Thanks in advance!
The code I use is VBA for Corel X5 that's why do not post it here... I try to pragmatically insert a new menu. I was able to do:
' Find main window handle using FindWindow(vbNullString, AppTitle), AppTitle = "CorelDRAW X5 - [" & ActiveDocument.FilePath & ActiveDocument.Name & "]"
' Find menu handle allocated dynamically but having the parent window handle (obtained using Spy++). Menu handle using FindWindowEx
' Simulate mouse right click SendMessage(Menu, BM_CLICK, 0, 0) for Press and SendMessage(Menu, RBM_UP, 0, 0) for Up .
' The window which appears at mouse right click receives a dynamic handle but respecting some rule for its class. Based on that I am able to obtain its handle. Based on that I am able to put mouse cursor on it (using SetCursorPos).
Now I need to move the mouse cursor over that window in order to trigger the Mouse Move event. Can anybody guide me in the right direction? Until now I tried 'mouse-event' API but I think is something which I do wrong and mouse cursor goes in the upper left corner of the screen...
Thanks in advance!