[RESOLVED] Problem with LVM_GETITEM and 64-bit OS, please help
I use the following code (original post by Bonnie West: https://www.vbforums.com/showthread....Clone-ListView) to get the Item from an external ListView. It works fine on Windows 7 32-bit (Unicode & ANSI), but on 64-bit System there is no return result, if ListView is Unicode (With ListView ANSI it is OK).
also make sure the OpenProcess call is returning success. May have to run as admin
Sorry dz32, I didn't make my problem clear. My code works on 64-bit Systems, however it only retrieves ListView ANSI Items, and ListView Unicode just empty strings.
Re: Problem with LVM_GETITEM and 64-bit OS, please help
You need to use 64-bit structures instead 32-bit ones for a 64-bit process:
Code:
Private Type HDITEM64
Mask As Long
cxy As Long
pszText As Currency
hbm As Currency
cchTextMax As Long
fmt As Long
lParam As Currency
iImage As Long
iOrder As Long
type As Long
lPad As Long
pvFilter As Currency
state As Long
End Type
Private Type LVITEM64
Mask As Long
iItem As Long
iSubItem As Long
state As Long
StateMask As Long
lPad As Long
pszText As Currency
cchTextMax As Long
iImage As Long
lParam As Currency
iIndent As Long
iGroupId As Long
cColumns As Long
lPad2 As Long
puColumns As Currency
piColFmt As Currency
iGroup As Long
End Type
Currency = a pointer. Don't forget to translate Long->Currency, for example:
Re: Problem with LVM_GETITEM and 64-bit OS, please help
Originally Posted by The trick
You need to use 64-bit structures instead 32-bit ones for a 64-bit process...
Thanks The trick, I tried using the 64-bit structures, but the result is still the same, besides, the application containing the ListView window is closed when executing the code.
Could you please check the code that I have attached?
Best regards,
FerrMask
Last edited by ferrmask; Sep 22nd, 2021 at 11:08 PM.