Aiakonai Posted July 18, 2008 Share Posted July 18, 2008 I'm trying to find out how I could view the contents of a label on a set of identical windows Is it possible to find out what controls are on a window if you only have the window handle? expandcollapse popup#include <guiconstants.au3> Opt("GUIOnEventMode",1) dim $x = "" $x = GUICreate("seven") GUISetOnEvent($GUI_EVENT_CLOSE,"clo",$x) GUICtrlCreateLabel("R1",25,25,100,20) GUICtrlCreateButton("read label",25,50,70,20) GUICtrlSetOnEvent(-1,"showLabel") GUISetState() $x = GUICreate("seven") GUISetOnEvent($GUI_EVENT_CLOSE,"clo",$x) GUICtrlCreateLabel("R2",25,25,100,20) GUICtrlCreateButton("read label",25,50,70,20) GUICtrlSetOnEvent(-1,"showLabel") GUISetState() GUIDelete($x) $x = GUICreate("seven") GUISetOnEvent($GUI_EVENT_CLOSE,"clo",$x) GUICtrlCreateLabel("R3",25,25,100,20) GUICtrlCreateButton("read label",25,50,70,20) GUICtrlSetOnEvent(-1,"showLabel") GUISetState() Func clo() GUIDelete(@GUI_WinHandle) EndFunc While 1 Sleep(100) WEnd Func showLabel() MsgBox(0,"","GUI_CTRLID"&@CRLF&@GUI_CTRLID&@CRLF&"GUI_WinHandle"&@CRLF&@GUI_WinHandle) EndFunc hmm... I wonder which key is the any key :O Link to comment Share on other sites More sharing options...
Andreik Posted July 18, 2008 Share Posted July 18, 2008 GUICtrlRead()? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Aiakonai Posted July 18, 2008 Author Share Posted July 18, 2008 guictrlread() only helps if I know what to read In this case im trying to read the label on the same window as the button that was clicked. with the window info tool I was able to determine that it has a control ID one less than the button, but not wanting to assume that this is always true I had hoped that someone had a better way of finding out how to determine that control id with the window handle. hmm... I wonder which key is the any key :O Link to comment Share on other sites More sharing options...
Andreik Posted July 18, 2008 Share Posted July 18, 2008 Read in help file about _WinAPI_GetDlgCtrlID, maybe is what you want. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Aiakonai Posted July 18, 2008 Author Share Posted July 18, 2008 (edited) sadly that is a deadend for me .. this gui has to be compatible with win95/2k/xp so I was forced to use an older version of autoit. There is no _WinAPI_GetDlgCtrlID in version 3.2.2.0. oh well muttley I guess ill just have to make arrays and use the title bar. Edited July 18, 2008 by Aiakonai hmm... I wonder which key is the any key :O Link to comment Share on other sites More sharing options...
JFee Posted July 18, 2008 Share Posted July 18, 2008 Eek! win95? Have fun with that compatibility. I tried testing a graphics server for my community TV station on a win2000 computer. Instead moving the score image up and down when I'd tell it to, it decided to move the entire window up and down muttley Regards,Josh 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