strate Posted August 16, 2007 Share Posted August 16, 2007 I have a script that I've been trying to figure out, but everything I've read while searching points to "it's not possible". I have 8 different GUIs to log events on. I need to be able to get all user actions such as: EVENT_CLOSE EVENT_MINIMIZE EVENT_RESTORE EVENT_MAXIMIZE EVENT_PRIMARYDOWN EVENT_PRIMARYUP Basically, if the user did anything I need to be able to pieces their actions together by reading the log. I'd like the log function to remain without parameters as well. What I have of the function so far is below and is still a work in progress. Func _Log() Local $File Local $Log = @ScriptDir & '\Log.txt' Local $aResult = DllCall("user32.dll", "int", "GetClassNameA", "hwnd", GUICtrlGetHandle(@GUI_CtrlId), "str", "", "int", 256) $s_ClassName = $aResult[2] $File = FileOpen($Log,1) FileWrite($File,_Now() & ' GUI:' & @GUI_WinHandle & ' Event ID:' & '' & ' Control: ' & $s_ClassName & ' Text/State on/of Control: ' & GUICtrlRead(@GUI_CtrlId) & @CRLF) FileClose($File) EndFunc As you can see I need to get a "ID" for the GUI. Each of my GUIs are titled the same and this needs to stay this way. Would it be "bad" to have a hidden label on each GUI to identify it? INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station... Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 16, 2007 Share Posted August 16, 2007 As you can see I need to get a "ID" for the GUI. Each of my GUIs are titled the same and this needs to stay this way. Would it be "bad" to have a hidden label on each GUI to identify it? To match on Title/Text, the text has to be visible. A hidden control could work with GuiCtrlRead(). When you create the GUIs you could just save the handle and use that. You could also use Opt("WinTitleMatchMode", 4) and go with instance, like: "[TITLE:Your Window Title;INSTANCE:2]". Handles are the most reliable, regardless. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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