how to get the message when the user clicked the uparrow?
-
I want to dill with the uparrow down message, I tried to use OnKeyDown and OnSysKeyDown ,but when the user pressed the uparrow both of the two function is not called ,why? please help me! thanks a lot!
I got a very simple solution for you. All you have to do is to add up arrow click to the accelerator table. You can find it in the ResourceView. Specify an ID for the up arrow click and then just click on the View menu and open Class Wizzard. There select which class you want the up arrow message to be processed and then find the ID you wrote in before. In messages double click on COMMAND and that's gonna add a method into your class that gets called every time you click up arrow. hope u get it to work
-
I want to dill with the uparrow down message, I tried to use OnKeyDown and OnSysKeyDown ,but when the user pressed the uparrow both of the two function is not called ,why? please help me! thanks a lot!
I got a very simple solution for you. All you have to do is to add up arrow click to the accelerator table. You can find it in the ResourceView. Specify an ID for the up arrow click and then just click on the View menu and open Class Wizzard. There select which class you want the up arrow message to be processed and then find the ID you wrote in before. In messages double click on COMMAND and that's gonna add a method into your class that gets called every time you click up arrow. hope u get it to work
-
I want to dill with the uparrow down message, I tried to use OnKeyDown and OnSysKeyDown ,but when the user pressed the uparrow both of the two function is not called ,why? please help me! thanks a lot!
Hello, Codeguru. I used to have the same problem a long time ago, but I did't remeber how to fix this problem so well.. But, 1) We can use PreTranslateMessage funnction in the dialog, and this function catches all message of the keystorke or mouse event before the message dispatches to each control. And, try to use CWnd* GetFocus() to check whether the up-arrow message is sure for the control which you want to check. 2) OnKeyDown function of each control may be called in subclassed derived class of each control. That is, we derived from the new class from each control class, and the message will be catched inside this class, and OnKeyDown will works. Since I didn't find these codes in my old project, I'm not sure these works. But, PreTranslateMessage function will works more than 2) HTH. -Masaaki Onishi-
-
I want to dill with the uparrow down message, I tried to use OnKeyDown and OnSysKeyDown ,but when the user pressed the uparrow both of the two function is not called ,why? please help me! thanks a lot!
Actually all you have to do is catch the WM_KEYUP event. Just go to classWizard, select the class you like to handle the event, and then choose WM_KEYUP from the message entries. Then, choose add function, and finally choose edit code. Then try AfxMessageBox(" up pressed"), and that will tell you if you were able to catch it or not. It worked for me, so I am sure it will for you. I tried the suggestion of adding the ID to the accelerator table but that didn't work. If you got it to work, I would be interested in how you did it. sayed hashimi