Modify

Opened 15 years ago

Closed 15 years ago

#1582 closed Bug (Fixed)

_GUICtrlListView_GetHeader returns no handle

Reported by: funkey Owned by: Jpm
Milestone: 3.3.7.0 Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

#include <GuiListView.au3>

Local $hGui = GUICreate("Bug-Test")
Local $hLV = GUICtrlCreateListView("Test", 0, 0)
Local $hHeader1 = _GUICtrlListView_GetHeader($hLV)
Local $hHeader2 = HWnd(_GUICtrlListView_GetHeader($hLV))
Local $aPos1 = ControlGetPos($hGui, "", $hHeader1)
Local $aPos2 = ControlGetPos($hGui, "", $hHeader2)

If Not IsArray($aPos1) Then MsgBox(16, "Error", "$hHeader1 is no handle!")
If Not IsArray($aPos2) Then MsgBox(16, "Error", "$hHeader2 is no handle!")
ConsoleWrite($hHeader1 & @CR)
ConsoleWrite($hHeader2 & @CR)

Change History (5)

comment:1 Changed 15 years ago by Jpm

I assume you are in the same problem of mixing GUICtrlCreate...() builtin functions and _GUICtrl...() UDF functions.
Try to use _GUICtrlListview_Create() instead of GUICtrlCreateListview()
Some UDF works but not all in the mixing mode ...
Such mixing mode must be avoid.
I know that some _GUICtrl...() doc examples are using this mixed mode but that too good. They are so may example to check that perhaps some day I will check them ;)

comment:2 Changed 15 years ago by funkey

That has nothing to do with mixing function. Sorry, but I would not post this problem when I did not have a look on to that.

#include <GuiListView.au3>

Local $hGui = GUICreate("Bug-Test")
Local $hLV = _GUICtrlListView_Create($hGui, "Test", 0, 0)
Local $hHeader1 = _GUICtrlListView_GetHeader($hLV)
Local $hHeader2 = HWnd(_GUICtrlListView_GetHeader($hLV))
Local $aPos1 = ControlGetPos($hGui, "", $hHeader1)
Local $aPos2 = ControlGetPos($hGui, "", $hHeader2)

If Not IsArray($aPos1) Then MsgBox(16, "Error", "$hHeader1 is no handle!")
If Not IsArray($aPos2) Then MsgBox(16, "Error", "$hHeader2 is no handle!")
ConsoleWrite($hHeader1 & @CR)
ConsoleWrite($hHeader2 & @CR)

comment:3 Changed 15 years ago by doudou

Both variants work in AutoIt v. 3.3.4.0 - 3.3.6.1
But you have to use:

_GUICtrlListView_GetHeader(GuiCtrlGetHandle($hLV))

comment:4 Changed 15 years ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

comment:5 Changed 15 years ago by Jpm

  • Milestone set to 3.3.7.0
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed by revision [5787] in version: 3.3.7.0

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.