Original Post
Hi all,
I need to be able to select items in such a way that if the control key is pressed it adds items together but if the control key is not pressed selecting items only selects the last item. Similar to Windows File explorer, selecting files with control key pressed adds the selected files, yet if control is not pressed only the last selection is selected. Here''s a small bit of my code:
LRESULT CALLBACK MenuMessaging(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) // Switch Messages
{
case WM_KEYDOWN:
switch (wParam)
{
case VK_CONTROL: // CONTROL KEY IS PRESSED
TimesRoman(185,20,30,8,500,RGB(255,128,128), "CTRL DOWN") ;
//return (LRESULT)1;
} // End Switch
break;
case WM_LBUTTONDOWN: // Was Left Mouse Button Pressed on Window
MousePos.x=LOWORD(lParam);
MousePos.y=HIWORD(lParam);
if ((MousePos.xbBattle[0].left))
if ((MousePos.ybBattle[0].top-50))
{
if (GetKeyState(VK_CONTROL)>=0) // IF cONTROL KEY IS NOT PRESSED
{
}
... etc
case WM_MOUSEMOVE:
MousePos.x=MousePosSet.x=LOWORD(lParam);
MousePos.y=MousePosSet.y=HIWORD(lParam);
...etc
I actually REM out the "case WM_KEYDOWN:" because I do the detecting with GetKeyState. I have added the additional code and remark statements to show what I have tried. My problem actually exits in the WM_MOUSEMOVE case statement. When Control is pressed my program never sees this case statement anymore, also my program slows to a halt. I thought my messaging function was getting over run with "VK_CONTROL" commands so I tried to somehow process them, hence the "return (LRESULT)1;", well it didn''t work. My program still never sees "case WM_MOUSEMOVE:" and my program slooows way down. Any advice would be appreciated, thanks.
Rob
rhuala@yahoo.com