RESOLUTION
To work around this problem, you can set or return a ColumnHeader Width
using the SendMessage API function with the LVM_SETCOLUMNWIDTH or
LVM_GETCOLUMNWIDTH messages.
The constant and function declarations are as follows:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Const LVM_FIRST = &H1000
Const LVM_GETCOLUMNWIDTH = LVM_FIRST + 29
Const LVM_SETCOLUMNWIDTH = LVM_FIRST + 30
To set the Width of a Columnheader using the message LVM_SETCOLUMNWIDTH,
you provide the index of the column (starting with 0) as the wParam and the
new width as the lParam. For example, the following statement sets the
width of the second column (index 1) of ListView1 to 150:
SendMessage ListView1.hWnd, LVM_SETCOLUMNWIDTH, 1, 150
To retrieve the Width of a Columnheader using the message
LVM_GETCOLUMNWIDTH, you provide the index of the column (starting with 0)
as the wParam. The lParam is unused and should be set to 0. For example,
the following statement returns the width of the second column (index 1) of
ListView1:
Dim LVWidth as Long
LVWidth = SendMessage (ListView1.hWnd, LVM_GETCOLUMNWIDTH, 1, 0)