pgv Posted April 1, 2009 Share Posted April 1, 2009 Hi Mates I am trying to automate profile creations on win 2000 environment. Under system properties, User Profiels tab, I want to set my focus(Highlight) to a particular profile under the box, profiles stored on this computer. I have tried to use various options like setfocus etc. but no luck any one has any idea how this can be achieved. I have attached the screen shots and I want to have the focus set on one of them Any help on this would be greatly appreciated. Regards PGV Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 1, 2009 Share Posted April 1, 2009 (edited) You need to get a handle to the SysListView32 control on the dialog using ControlGetHandle(). Once you've got it, you can use the _GUICtrlListView* functions to examine the contents of the view and select a particular profile. AutoIt Window Info is your friend here. WBD Edited April 1, 2009 by WideBoyDixon [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
pgv Posted April 1, 2009 Author Share Posted April 1, 2009 Thanks a lot WBD for guiding me to the right directionCheerpgvYou need to get a handle to the SysListView32 control on the dialog using ControlGetHandle(). Once you've got it, you can use the _GUICtrlListView* functions to examine the contents of the view and select a particular profile.AutoIt Window Info is your friend here.WBD Link to comment Share on other sites More sharing options...
pgv Posted April 1, 2009 Author Share Posted April 1, 2009 Hi mate This is the code I am using $c=ControlGetHandle("System Properties","Profiles stored on this computer:",1000) if not ControlGetHandle("System Properties","Profiles stored on this computer:",1000) Then msgbox(1, "","NF") Else Msgbox(1,"",$c) EndIf The handler given by Autoit window info is different to what the msg box give me In Autoit window info the classNameNN is SysListview32 and Advance Class :[CLASS:SysList32:INSTANCE:1] and ID is 1000. I am not able to proceed further any help is much appreciated. Cheers pgv Thanks a lot WBD for guiding me to the right direction Cheer pgv Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 1, 2009 Share Posted April 1, 2009 (edited) #include <GuiListView.au3> #include <Array.au3> Local $wText = "User Profiles" Switch @OSVersion Case "WIN_2000" $wText = "System Properties" Case "WIN_XP" $wText = "User Profiles" EndSwitch $hListView = ControlGetHandle($wText, "", "[CLASS:SysListView32; INSTANCE:1]") If @error = 1 Then MsgBox(1, "", "Not Found") Else $itemCount = _GUICtrlListView_GetItemCount($hListView) For $i = 0 To $itemCount - 1 $itemText = _GUICtrlListView_GetItemTextArray($hListView, $i) MsgBox(1, "", _ArrayToString($itemText, " --> ", 1)) Next EndIf Edited April 1, 2009 by WideBoyDixon [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
pgv Posted April 1, 2009 Author Share Posted April 1, 2009 thanks once again mate! Cheers pgv Link to comment Share on other sites More sharing options...
pgv Posted April 2, 2009 Author Share Posted April 2, 2009 extending my thanks to WBD, now I am able to list the profile as per my requirement but, when I am trying to set my focus on one of them it does not work I am using the ControlGetFocus($itemText,$p), I have also tried to use the SysListview32 but focus does not seems to be moving on.. any help would be much appreciated.thankspgvthanks once again mate!Cheerspgv 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