Jump to content

_GUICtrlListBox_SelectString


Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...