Jul 22, 2008 9:00 PM
SendMessage() in Win64
Hi,
I am new to Windows API. And I have been assigned the task to check the compatibility of a project on Windows 64 bit Operating system.
I have a ListView control which is dynamically populated and on the click event of any row in the table two buttons are enabled.
I have used the SendMessage function to handle the Mouse click event on a particular row. Althoug it works fine in 32 bit the code doesn't work in 64 bit.
Below is the code snippet.
case NM_CLICK:
// Get highlighted row
m_index = SendMessage(hWndView, LVM_GETHOTITEM, 0, 0);
if(m_index < 0)
{
EnableWindow(GetDlgItem(hDlg, IDC_GET_HOST), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_UNENROLL_HOST), FALSE);
}
else
{
EnableWindow(GetDlgItem(hDlg, IDC_GET_HOST), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_UNENROLL_HOST), TRUE);
}
break;
Note: I have previously defined the variable m_index. The function SendMessage always returns a value -1 because of whihc the buttons are not activated.
Any help will be appreciated.
Its kinda urgent.
Thanks in advance
Amrita