views:

23

answers:

0

I am using SysMonthCal32 windows in my application and I am seeing some strange problems while using it.

The problem is regarding sending keydown event to calendar window. As per msdn documentation, if the window handles the message, it should return 0. The problem is whatever key i passes to the calendar window, it returns 0. This causes a problem in my application as some keys like Escape have to be processed by application. Here is the proper use-case:

I have a application which uses SysMonthCal32 window in case to display calendar. So when calendar window is displayed to screen, i passes all the key stroke to calendar window and listen to the response returned from calendar widow. In case it does not handles, i pass the event to the application which processes the key_down event accordingly. The case I am struck is Escape key, since calendar windows does not performs any action on esc key, it should return that it has not processed escape key and when i pass the esc key to application, it will dismiss the calendar widget.

I pass the event to calenar using

result = CallWindowProc(winProc, HWND, msg, wParam, lParam);

and then monitors the value of result.

I think, i am doing some silly mistake as calendar window should not behave in such manner.

Please don't say that i check for Esc key before passing it to calendar widget because i cannot check any key and window control before passing it.

Please help me because I am struck in this problem and using Winspector and Spy++ didn't help me. I am new to using Windows API and needs your help.

Thanks for reading such a long question. In case there is some confusion in the question, please let me know so that I can clarify it.