May 01, 2024, 03:23:21 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Detecting Enter key in listview

Started by ExMember001, November 15, 2006, 01:59:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ExMember001

Hi,
I'm Trying to detect enter key in OnNotify()
a key is detect but the enter key is not return...
What am i doing wrong?


if(code = LVNKEYDOWN) /* Double click droit */
    {
    if (*(NMLISTVIEW)pnmhdr.iItem) <> -1
    {

NMTCKEYDOWN VKey;
messagebox(this,numtostr(Vkey.wVKey),"test");
if Vkey.wVKey = 0x0D //Enter
{
//do something
}
}
}

sapero

KrYpT, LVN_KEYDOWN Notification has other syntax, the lParam points to NMLVKEYDOWN structure
struct LVKEYDOWN {
    NMHDR hdr;
    WORD wVKey; // Virtual key code
    UINT flags; // zero
}

You can download free winsows xp/server/vista platform SDK, or the whole MSDN and lookup here for all questions :)

ExMember001

i've tryed NMTCKEYDOWN (already defined Aurora struct) which is the same as NMLVKEYDOWN (also tryed)
it return the samething...

ExMember001

ok found it,
if (*(NMTCKEYDOWN)pnmhdr.wVKey) = 0x0D //Enter
is doing the trick ;)

Thank sapero :)