BennyB Posted January 29, 2007 Share Posted January 29, 2007 First excuse my english, it isn't my foreign language. I woult like to get the ID of an object when the mouse button was pressed. Or when a keystroke was done. Have anybody an idea? Thanks for help Link to comment Share on other sites More sharing options...
/dev/null Posted January 29, 2007 Share Posted January 29, 2007 First excuse my english, it isn't my foreign language.I woult like to get the ID of an object when the mouse button was pressed.Or when a keystroke was done.Have anybody an idea?Thanks for helpDllCall() and Win API function WindowFromPoint() http://msdn.microsoft.com/library/en-us/wi....asp?frame=trueCheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
BennyB Posted January 29, 2007 Author Share Posted January 29, 2007 I'm not a specialist in programming whit windows components. I've tried following .vbs code: Option Explicit Dim oShell Dim oAutoIt Dim temp Dim temp2 Set oShell = WScript.CreateObject("WScript.Shell") Set oAutoIt = WScript.CreateObject("AutoItX3.Control") Set oTemp = WScript.CreateObject("user32.dll") oAutoIt.Run "c:\windows\notepad.exe" oAutoIt.WinWait "Unbenannt","" oAutoIt.ControlSend "Unbenannt ", "", 15, "{ENTER}" temp2 = MouseGetPos() temp = oTemp.WindowFromPoint(temp2) oAutoTi.ControlSend "Unbenannt ", "", 15, temp WScript.Quit Error: "An automaticclass with the name user32.dll wasn't found" My aim is, that i would like to have the ID of an Button in a variable. Thanks for helping me Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 30, 2007 Share Posted January 30, 2007 User32 is not an object. It is a dynamic link library. That means it just contains a bunch of functions that can be called from other programs. Link to comment Share on other sites More sharing options...
BennyB Posted January 30, 2007 Author Share Posted January 30, 2007 OK. I solve a part of my problem, but.. At the moment I can get the position of the mouse and the controlname of the item under it. But I can't verify if the mouse was clicked. I would not have the name of the controls I mouseover. I hope you understand me. A part of my code below (c++): mousepos.x = AU3_MouseGetPosX(); mousepos.y = AU3_MouseGetPosY(); window = WindowFromPoint(mousepos); GetWindowText(window, pcWinTitle, 255); Link to comment Share on other sites More sharing options...
Uten Posted January 30, 2007 Share Posted January 30, 2007 @Larry has a some samples in Example Scripts showing how to do this in autoit.What you can do in c++ Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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