Sign in to follow this  
Followers 0
nlgoh

Listbox vs ListView

6 posts in this topic

Hi all,

Need some help here with Listbox. I wrote a script using that using Listbox and tested on my laptop. Everything is working as expected. However, when I ran the same script on the other PC, the main window didn't come out, although there is an icon indicated that the script is running. After spending some time debugging, I found out that if I were to change listbox to listview, the main window will displayed as expected. Both my laptop and PC are running WIn7 service pack 1.... Any ideas what's wrong with my PC? Do I need to get some plug-in for listbox to work?

Thanks.

Share this post


Link to post
Share on other sites



Without script? No.

Share this post


Link to post
Share on other sites

Actually, I can just use a simple GUI script to duplicate the problem.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 613, 431, 192, 132)
$Input1 = GUICtrlCreateInput("Input1", 264, 48, 209, 24)
$Edit1 = GUICtrlCreateEdit("", 256, 96, 217, 225)
GUICtrlSetData(-1, "Edit1")
$List1 = GUICtrlCreateList("", 40, 40, 185, 262)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

With the above script, no window when executed on my PC. By replacing "$List1 = GUICtrlCreateList("", 40, 40, 185, 262)" to "$List1 = GUICtrlCreateListView("", 40, 40, 185, 262)", everything works.

Share this post


Link to post
Share on other sites

Works as expected. Which AutoItversion did you use?

Share this post


Link to post
Share on other sites

The latest version, v3.3.14.2... The script works on my laptop, but not on another PC..

Share this post


Link to post
Share on other sites

Found the problem. Main window did come out but not in the visible range of monitor for Listbox.. So I added

$hmWnd = WinWait("[TITLE:XXX]", "", 10)
WinMove($hmWnd, "", 0, 0)

And it works.. Thanks.

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  
Followers 0