www.teamdev.com

This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
2 Replies Last post: Jul 31, 2008 1:00 PM by Vladimir Ikryanov  
Click to view Amrita's profile   2 posts since
Jul 22, 2008

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

Click to view Vladimir Ikryanov's profile TeamDev Ltd. 350 posts since
Apr 24, 2006
2. Jul 31, 2008 1:00 PM in response to: Amrita
Re: SendMessage() in Win64
Hi Amrita,

And how exactly you use JNIWrapper in this case?

Regards,
Vladimir Ikryanov