Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Can’t determine if Tab/Esc is pressed within case LVN_ENDLABELEDIT:

$
0
0

Hi all,

I am developing in Native C++ in a Win32 API environment using Visual Studio 2008. I need to determine if and when the Tab or Esc key is pressed when a listView is in Edit Mode within the LVN_ENDLABELEDIT notification.

I have tried sub-classing the system generated control without success. I can trap any other key but not the tab or escape keys. The excerpt from the sub-classed proc is:

switch(message)

{

case WM_CHAR:

           switch(wParam)

           {

           case 0x09: // Tab

                       // Program lines

                       break;

           case 0x1B: // Esc

                       // Program lines

                       break;

           }

}

I have also tried to use the method as found in the Code Project example and can’t get it to work, excerpt as follows:

tchar = (TCHAR)msg.wParam;

if(tchar == 0x1b) escKey=1;

I would prefer to use the Code Project’s suggestion, if I can get it to work. Or. perhaps there is a better way. Any suggestions, comments etc would be appreciated.

Regards,

Richard



Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>