ListView header handle

  • Thread starter Thread starter Simon Abolnar
  • Start date Start date
S

Simon Abolnar

I am using VB.NET 2003
Framework 1.1

How can I get ListView header handle.
I tried in this way:

Dim headerHandle As IntPtr

HeaderHandle=SendMessage(listView.Handle.ToInt32, LVM_GETHEADER,0,0)

SendMessage return int value, not IntPtr.
How can I convert int to IntPtr?

Thanks all!
 
* "Simon Abolnar said:
I am using VB.NET 2003
Framework 1.1

How can I get ListView header handle.
I tried in this way:

Dim headerHandle As IntPtr

HeaderHandle=SendMessage(listView.Handle.ToInt32, LVM_GETHEADER,0,0)

SendMessage return int value, not IntPtr.
How can I convert int to IntPtr?

Declare it as 'IntPtr'. And declare the 'hWnd' parameter as 'IntPtr'
too. Even better: Post your 'SendMessage' declare.
 
This is mySendMessage declaration:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer,
ByVal lParam As Integer) As Integer

Simon
 
* "Simon Abolnar said:
This is mySendMessage declaration:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer,
ByVal lParam As Integer) As Integer

Declare the function as 'Auto' ('Declare Auto Function') and remove the
alias. Then change the type pf the 1st parameter to 'IntPtr' and the
type of the return value to 'IntPtr' too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top