Jump to content
Sign in to follow this  
YoungRacoon

_GUICtrlListBox_SelectString

Recommended Posts

YoungRacoon

Hi. I would like to save IE bookmarks.

Local $SleepPeriod = 2000
$oIE = _IECreate ()
WinWaitActive("about:blank")
    
Send("!F")  ;  File menu
Sleep ($SleepPeriod)
Send("I")   ; "Import and Export" item
Sleep ($SleepPeriod)
Send("!N") ; "Next" button
Sleep ($SleepPeriod)

Local $listbox = ControlGetHandle("", "", 17011)  ; ListBox control
Local $listitem = _GUICtrlListBox_SelectString($listbox, "Export Favorites"); Required item is selected successfully.
    
Sleep ($SleepPeriod)
Send("!N");  When I click "ALT-N" here, the first item ("Import Favorites") is used, not the item selected earlier ("Export Favorites")

What's wrong with my code? Of course, I can use Send ("{Down}") instead of _GUICtrlListBox_SelectString but it's really intresting to work with ListBox directly.

Thanks.

Edited by YoungRacoon

Share this post


Link to post
Share on other sites
YoungRacoon

Hi. I would like to save IE bookmarks.

Local $SleepPeriod = 2000
$oIE = _IECreate ()
WinWaitActive("about:blank")
    
Send("!F") ;  File menu
Sleep ($SleepPeriod)
Send("I")  ; "Import and Export" item
Sleep ($SleepPeriod)
Send("!N"); "Next" button
Sleep ($SleepPeriod)

Local $listbox = ControlGetHandle("", "", 17011) ; ListBox control
Local $listitem = _GUICtrlListBox_SelectString($listbox, "Export Favorites"); Required item is selected successfully.
    
Sleep ($SleepPeriod)
Send("!N");  When I click "ALT-N" here, the first item ("Import Favorites") is used, not the item selected earlier ("Export Favorites")

What's wrong with my code? Of course, I can use Send ("{Down}") instead of _GUICtrlListBox_SelectString but it's really intresting to work with ListBox directly.

Thanks.

Closed.

Instead of _GUICtrlListBox_SelectString I used ControlCommand ("","", $id, "SelectString", $string).

Instead of Send("!N") I used ControlClick($title, $text, $id)

It works.

Share this post


Link to post
Share on other sites
BrettF

Closed.

Instead of _GUICtrlListBox_SelectString I used ControlCommand ("","", $id, "SelectString", $string).

Instead of Send("!N") I used ControlClick($title, $text, $id)

It works.

From memory GeoSoft was working on something similar. Not sure if it was public though... Maybe wait to see what he says... :D

Share this post


Link to post
Share on other sites
YoungRacoon

From memory GeoSoft was working on something similar. Not sure if it was public though... Maybe wait to see what he says... :D

Anyone kept silence except you. So I decided I'd asked something silly and got to rewrite my code though I'm still eager to know what was wrong with the initial code :D

Edited by YoungRacoon

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×