Jump to content

Is it a bug or !?!?!


UEZ
 Share

Recommended Posts

Hi,

I've created a GUI and found a strange behaviour when selecting with the mouse (lmb) a line in the window on the right handside!

I've created 4 buttons (Browse Folder, Read folder content, Exit and List Content). When I click one by one through the lines then in line 5,8,9 and 12 the button functions will be executes which I never defined!

The behaviour of the other lines are normal = nothing happens.

When clicking in line

5 -> Browse button will be executed

8 -> Read Folder button will be executed

9 -> Exit button will be executed

12 -> List Content button will be executed

When you change the position in the code for the $Buttonx then the behaviour changes also when clicking to a line.

Is this normal?

#include <GUIConstants.au3>
#include <GuiListView.au3>

#Region ### START Koda GUI section ### Form=d:\coding\scripts\au3\content viewer.kxf
$Form = GUICreate("Test", 795, 590, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_TABSTOP, $WS_BORDER, $WS_CLIPSIBLINGS))
$Input = GUICtrlCreateGroup("Input", 16, 8, 761, 65)
$Button1 = GUICtrlCreateButton("Browse Folder", 496, 26, 81, 32, 0)
$Input1 = GUICtrlCreateInput("Test", 32, 32, 457, 20, 0, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Read = GUICtrlCreateButton("Read", 768, -254, 97, 32, 0)
$Button2 = GUICtrlCreateButton("Read folder content", 583, 26, 113, 32, 0)
$Button3 = GUICtrlCreateButton("Exit", 720, 26, 51, 32, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Viewer = GUICtrlCreateGroup("Viewer", 16, 80, 761, 473)
$Button4 = GUICtrlCreateButton("List Content", 24, 520, 75, 25, 0)
$Content = GUICtrlCreateListView("Line", 168, 96, 601, 449, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS, $WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_FLATSB))
$FileList = GUICtrlCreateListView("Filenames|", 24, 96, 138, 418, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUICtrlSendMsg(-1, 0x101E, 0, 175)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUICtrlCreateListViewItem("File1", $FileList)
GUICtrlCreateListViewItem("File2", $FileList)
GUICtrlCreateListViewItem("File3", $FileList)
GUICtrlCreateListViewItem("File4", $FileList)
GUICtrlCreateListViewItem("File5", $FileList)
GUICtrlCreateListViewItem("File6", $FileList)

_GUICtrlListView_AddColumn($Content, "Servername", 120, 0)
_GUICtrlListView_AddColumn($Content, "Manufacturer", 160, 0)
_GUICtrlListView_AddColumn($Content, "Product Name", 100, 0)
_GUICtrlListView_AddColumn($Content, "Serial Number", 100, 0)
_GUICtrlListView_AddColumn($Content, "Bios Version", 100, 0)
_GUICtrlListView_AddColumn($Content, "Processor Name", 200, 0)
_GUICtrlListView_AddColumn($Content, "Processor Max Clock Speed", 100, 0)
_GUICtrlListView_AddColumn($Content, "total CPU(s),phys. CPU(s)", 175, 0)
_GUICtrlListView_AddColumn($Content, "Memory Capacity", 120, 0)

_GUICtrlListView_AddItem($Content, 1, 2)
_GUICtrlListView_AddItem($Content, 2, 2)
_GUICtrlListView_AddItem($Content, 3, 2)
_GUICtrlListView_AddItem($Content, 4, 2)
_GUICtrlListView_AddItem($Content, 5, 2)
_GUICtrlListView_AddItem($Content, 6, 2)
_GUICtrlListView_AddItem($Content, 7, 2)
_GUICtrlListView_AddItem($Content, 8, 2)
_GUICtrlListView_AddItem($Content, 9, 2)
_GUICtrlListView_AddItem($Content, 10, 2)
_GUICtrlListView_AddItem($Content, 11, 2)
_GUICtrlListView_AddItem($Content, 12, 2)
_GUICtrlListView_AddItem($Content, 13, 2)
_GUICtrlListView_AddItem($Content, 14, 2)
_GUICtrlListView_AddItem($Content, 15, 2)
_GUICtrlListView_AddItem($Content, 16, 2)


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

        Case $Button1
            MsgBox(0, "Test", "You pressed the browse button!")

        Case $Button2
            MsgBox(0, "Test", "You pressed the Read Folder button!")

        Case $Button3
            MsgBox(0, "Test", "You pressed the Exit button!")

        Case $Button4
            MsgBox(0, "Test", "You pressed the Liste Content button!")

    EndSwitch
WEnd

Thanks.

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I think this is a problem inside _GUICtrlListView_InsertItem(). It's assign control id that already used in the window (althought it should not happen).

As workaround, you can create the buttons after the added ListView items:

#include <GUIConstants.au3>
#include <GuiListView.au3>

$Form = GUICreate("Test", 795, 590, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_TABSTOP, $WS_BORDER, $WS_CLIPSIBLINGS))

$Input = GUICtrlCreateGroup("Input", 16, 8, 761, 65)
$Input1 = GUICtrlCreateInput("Test", 32, 32, 457, 20, 0, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Read = GUICtrlCreateButton("Read", 768, -254, 97, 32, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Viewer = GUICtrlCreateGroup("Viewer", 16, 80, 761, 473)

$Content = GUICtrlCreateListView("Line", 168, 96, 601, 449, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS, $WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_FLATSB))

$FileList = GUICtrlCreateListView("Filenames|", 24, 96, 138, 418, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUICtrlSendMsg(-1, 0x101E, 0, 175)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

GUICtrlCreateListViewItem("File1", $FileList)
GUICtrlCreateListViewItem("File2", $FileList)
GUICtrlCreateListViewItem("File3", $FileList)
GUICtrlCreateListViewItem("File4", $FileList)
GUICtrlCreateListViewItem("File5", $FileList)
GUICtrlCreateListViewItem("File6", $FileList)

_GUICtrlListView_AddColumn($Content, "Servername", 120, 0)
_GUICtrlListView_AddColumn($Content, "Manufacturer", 160, 0)
_GUICtrlListView_AddColumn($Content, "Product Name", 100, 0)
_GUICtrlListView_AddColumn($Content, "Serial Number", 100, 0)
_GUICtrlListView_AddColumn($Content, "Bios Version", 100, 0)
_GUICtrlListView_AddColumn($Content, "Processor Name", 200, 0)
_GUICtrlListView_AddColumn($Content, "Processor Max Clock Speed", 100, 0)
_GUICtrlListView_AddColumn($Content, "total CPU(s),phys. CPU(s)", 175, 0)
_GUICtrlListView_AddColumn($Content, "Memory Capacity", 120, 0)

_GUICtrlListView_AddItem($Content, 1, 2)
_GUICtrlListView_AddItem($Content, 2, 2)
_GUICtrlListView_AddItem($Content, 3, 2)
_GUICtrlListView_AddItem($Content, 4, 2)
_GUICtrlListView_AddItem($Content, 5, 2)
_GUICtrlListView_AddItem($Content, 6, 2)
_GUICtrlListView_AddItem($Content, 7, 2)
_GUICtrlListView_AddItem($Content, 8, 2)
_GUICtrlListView_AddItem($Content, 9, 2)
_GUICtrlListView_AddItem($Content, 10, 2)
_GUICtrlListView_AddItem($Content, 11, 2)
_GUICtrlListView_AddItem($Content, 12, 2)
_GUICtrlListView_AddItem($Content, 13, 2)
_GUICtrlListView_AddItem($Content, 14, 2)
_GUICtrlListView_AddItem($Content, 15, 2)
_GUICtrlListView_AddItem($Content, 16, 2)

$Button1 = GUICtrlCreateButton("Browse Folder", 496, 26, 81, 32, 0)
$Button2 = GUICtrlCreateButton("Read folder content", 583, 26, 113, 32, 0)
$Button3 = GUICtrlCreateButton("Exit", 720, 26, 51, 32, 0)
$Button4 = GUICtrlCreateButton("List Content", 24, 520, 75, 25, 0)

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

        Case $Button1
            MsgBox(0, "Test", "You pressed the browse button")

        Case $Button2
            MsgBox(0, "Test", "You pressed the Read Folder button!")

        Case $Button3
            MsgBox(0, "Test", "You pressed the Exit button!")

        Case $Button4
            MsgBox(0, "Test", "You pressed the Liste Content button!")

    EndSwitch
WEnd
Edited by MsCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Thanks for the quick reply, but this is just a quick extract of my original code.

Normally I add the item when pressing one of the 4 buttons. that means, that the add function will be called when pressing one of the 4 buttons inside the while loop.

#include <GUIConstants.au3>
#include <GuiListView.au3>

$Form = GUICreate("Test", 795, 590, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_TABSTOP, $WS_BORDER, $WS_CLIPSIBLINGS))

$Input = GUICtrlCreateGroup("Input", 16, 8, 761, 65)
$Input1 = GUICtrlCreateInput("Test", 32, 32, 457, 20, 0, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Read = GUICtrlCreateButton("Read", 768, -254, 97, 32, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Viewer = GUICtrlCreateGroup("Viewer", 16, 80, 761, 473)

$Content = GUICtrlCreateListView("Line", 168, 96, 601, 449, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS, $WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_FLATSB))

$FileList = GUICtrlCreateListView("Filenames|", 24, 96, 138, 418, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
GUICtrlSendMsg(-1, 0x101E, 0, 175)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)



$Button1 = GUICtrlCreateButton("Browse Folder", 496, 26, 81, 32, 0)
$Button2 = GUICtrlCreateButton("Read folder content", 583, 26, 113, 32, 0)
$Button3 = GUICtrlCreateButton("Exit", 720, 26, 51, 32, 0)
$Button4 = GUICtrlCreateButton("List Content", 24, 520, 75, 25, 0)

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

        Case $Button1
            MsgBox(0, "Test", "You pressed the browse button: " & $nMsg)

        Case $Button2
            GUICtrlCreateListViewItem("File1", $FileList)
            GUICtrlCreateListViewItem("File2", $FileList)
            GUICtrlCreateListViewItem("File3", $FileList)
            GUICtrlCreateListViewItem("File4", $FileList)
            GUICtrlCreateListViewItem("File5", $FileList)
            GUICtrlCreateListViewItem("File6", $FileList)
            MsgBox(0, "Test", "You pressed the Read Folder button!")

        Case $Button3
            MsgBox(0, "Test", "You pressed the Exit button!")

        Case $Button4
            _GUICtrlListView_AddColumn($Content, "Servername", 120, 0)
            _GUICtrlListView_AddColumn($Content, "Manufacturer", 160, 0)
            _GUICtrlListView_AddColumn($Content, "Product Name", 100, 0)
            _GUICtrlListView_AddColumn($Content, "Serial Number", 100, 0)
            _GUICtrlListView_AddColumn($Content, "Bios Version", 100, 0)
            _GUICtrlListView_AddColumn($Content, "Processor Name", 200, 0)
            _GUICtrlListView_AddColumn($Content, "Processor Max Clock Speed", 100, 0)
            _GUICtrlListView_AddColumn($Content, "total CPU(s),phys. CPU(s)", 175, 0)
            _GUICtrlListView_AddColumn($Content, "Memory Capacity", 120, 0)

            _GUICtrlListView_AddItem($Content, 1, 2)
            _GUICtrlListView_AddItem($Content, 2, 2)
            _GUICtrlListView_AddItem($Content, 3, 2)
            _GUICtrlListView_AddItem($Content, 4, 2)
            _GUICtrlListView_AddItem($Content, 5, 2)
            _GUICtrlListView_AddItem($Content, 6, 2)
            _GUICtrlListView_AddItem($Content, 7, 2)
            _GUICtrlListView_AddItem($Content, 8, 2)
            _GUICtrlListView_AddItem($Content, 9, 2)
            _GUICtrlListView_AddItem($Content, 10, 2)
            _GUICtrlListView_AddItem($Content, 11, 2)
            _GUICtrlListView_AddItem($Content, 12, 2)
            _GUICtrlListView_AddItem($Content, 13, 2)
            _GUICtrlListView_AddItem($Content, 14, 2)
            _GUICtrlListView_AddItem($Content, 15, 2)
            _GUICtrlListView_AddItem($Content, 16, 2)
            MsgBox(0, "Test", "You pressed the Liste Content button!")

    EndSwitch
WEnd

In this case you get the same problem again in different lines!

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Then i think you should make a bug report, because this is not expected (and not acceptable as well) behaviour.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Then i think you should make a bug report, because this is not expected (and not acceptable as well) behaviour.

How can I do that? Can this threat not be moved to the bug section? :)

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Then i think you should make a bug report, because this is not expected (and not acceptable as well) behaviour.

http://www.autoitscript.com/forum/index.php?showtopic=59685

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

It's a pity. ;)

Let's wait for the next release... :D

Thanks for support! :)

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

If you read down in that thread I posted how to fix your version.

Thanks GaryFrost! :) Sorry, I only flew over the post - my fault.

Now it's really working... ;)

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Hi guys, this is very strange and this don`t like me :)

I tryed make this so:

#include <GUIConstants.au3>
#include <GuiListView.au3>

$Form = GUICreate("Test", 795, 590, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_TABSTOP, $WS_BORDER, $WS_CLIPSIBLINGS))

$Input = GUICtrlCreateGroup("Input", 16, 8, 761, 65)
$Button1 = GUICtrlCreateButton("Browse Folder", 496, 26, 81, 32)
$Button1 = GUICtrlGetHandle($Button1)

$Input1 = GUICtrlCreateInput("Test", 32, 32, 457, 20, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")

$Read = GUICtrlCreateButton("Read", 768, -254, 97, 32, 0)
$Read = GUICtrlGetHandle($Read)

$Button2 = GUICtrlCreateButton("Read folder content", 583, 26, 113, 32, 0)
$Button2 = GUICtrlGetHandle($Button2)

$Button3 = GUICtrlCreateButton("Exit", 720, 26, 51, 32, 0)
$Button3 = GUICtrlGetHandle($Button3)
GUICtrlCreateGroup("", -99, -99, 1, 1)

$Viewer = GUICtrlCreateGroup("Viewer", 16, 80, 761, 473)
$Button4 = GUICtrlCreateButton("List Content", 24, 520, 75, 25)
$Button4 = GUICtrlGetHandle($Button4)

$FileList = GUICtrlCreateListView("Filenames|", 24, 96, 138, 418, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))

GUICtrlSendMsg(-1, 0x101E, 0, 175)

GUICtrlCreateListViewItem("File1", $FileList)
GUICtrlCreateListViewItem("File2", $FileList)
GUICtrlCreateListViewItem("File3", $FileList)
GUICtrlCreateListViewItem("File4", $FileList)
GUICtrlCreateListViewItem("File5", $FileList)
GUICtrlCreateListViewItem("File6", $FileList)

$Content = GUICtrlCreateListView("Line", 168, 96, 601, 449, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS), BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_FLATSB))
$hListView = GUICtrlGetHandle($Content)

_GUICtrlListView_BeginUpdate($hListView)
_GUICtrlListView_AddColumn($hListView, "Servername", 120, 0)
_GUICtrlListView_AddColumn($hListView, "Manufacturer", 160, 0)
_GUICtrlListView_AddColumn($hListView, "Product Name", 100, 0)
_GUICtrlListView_AddColumn($hListView, "Serial Number", 100, 0)
_GUICtrlListView_AddColumn($hListView, "Bios Version", 100, 0)
_GUICtrlListView_AddColumn($hListView, "Processor Name", 200, 0)
_GUICtrlListView_AddColumn($hListView, "Processor Max Clock Speed", 100, 0)
_GUICtrlListView_AddColumn($hListView, "total CPU(s),phys. CPU(s)", 175, 0)
_GUICtrlListView_AddColumn($hListView, "Memory Capacity", 120, 0)

_GUICtrlListView_AddItem($hListView, 1)
_GUICtrlListView_AddItem($hListView, 2)
_GUICtrlListView_AddItem($hListView, 3)
_GUICtrlListView_AddItem($hListView, 4)
_GUICtrlListView_AddItem($hListView, 5)
_GUICtrlListView_AddItem($hListView, 6)
_GUICtrlListView_AddItem($hListView, 7)
_GUICtrlListView_AddItem($hListView, 8)
_GUICtrlListView_AddItem($hListView, 9)
_GUICtrlListView_AddItem($hListView, 10)
_GUICtrlListView_AddItem($hListView, 11)
_GUICtrlListView_AddItem($hListView, 12)
_GUICtrlListView_AddItem($hListView, 13)
_GUICtrlListView_AddItem($hListView, 14)
_GUICtrlListView_AddItem($hListView, 15)
_GUICtrlListView_AddItem($hListView, 16)
_GUICtrlListView_EndUpdate($hListView)
GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg(1)
    Select
    Case $nMsg[0] = $GUI_EVENT_CLOSE Or $nMsg[2] = $Button3
        ExitLoop
    Case $nMsg[2] = $Button1
        MsgBox(0, $nMsg[2], "You pressed the browse button!")
    Case $nMsg[2] = $Button2
        MsgBox(0, "Test", "You pressed the Read Folder button!")
    Case $nMsg[2] = $Button3
        MsgBox(0, "Test", "You pressed the Exit button!")
    Case $nMsg[2] = $Button4
        MsgBox(0, "Test", "You pressed the Liste Content button!")
    EndSelect
WEnd

But still strange behavior occured...if i pressed ListView item #5 i getting a MsgBox with "You pressed the browse button!" ;)

Link to comment
Share on other sites

Hi guys, this is very strange and this don`t like me :)

I tryed make this so:

...

But still strange behavior occured...if i pressed ListView item #5 i getting a MsgBox with "You pressed the browse button!" ;)

I just opened GuiListView.au3 from Include dir and edited the line 3885 (before you have to remove read-only attribut probably):

old line -> new line

DllStructSetData($tItem, "Param", $iParam) -> DllStructSetData($tItem, "Param", 0)

Save it and run test script again. Now no unexpected behaviour by pressing the lines 5 etc.

:D

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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...