Regards
Shahzad
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Mohammad Shahzad Saleem" <shah...@systemsltd.com.pk> wrote in message
news:uRdAdxHzCHA.2296@TK2MSFTNGP10...
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
"Mohammad Shahzad Saleem" <shah...@systemsltd.com.pk> wrote in message
news:#Q28BfPzCHA.1636@TK2MSFTNGP10...
Please tell me the steps to achieve the keyboard accelerators get processed.
I dont know when & where to call the TranslateAccelerator API. and how to
handle the WM_COMMAND Message in ActiveX control.
I read about message pump while searching the web and consulting the msdn.
it is written there that messaeg pump should be placed in the WinMain. i
dont find any relationg of WinMain to the ActiveX Control.
Everybody talks about that the key combinations like Ctrl+O, ALT+M etc can
be processed using accelerator tabel in the ActiveX control. but when it
comes to explain they end up explaining how to handle Tab, Enter and Esc
keys. I am stuck at this point i wonder wehat the heck is this.
i am developing multi-lingual edit box and editor control.. in that control
i need to trap keys pressed on keyboard in combination for marking the text,
changing editing modes and switching between the languages during run time.
I dont believe that Ctrl+C, Ctrl+V & Ctrl+X keys have never been implemented
in windows standard edit boxes! then why cant i ...?
please give me usefull suggestions
i will be greatfull.
Regards
Mohammad Shahzad Saleem
"Igor Tandetnik" <itand...@whenu.com> wrote in message
news:uq1FSTJzCHA.1924@TK2MSFTNGP12...
It's there in the ATL source code, and it does get called. Maybe yours
has an incorrect signature. It should be
BOOL PreTranslateAccelerator(LPMSG pMsg, HRESULT& hRet);
You return TRUE if you have processed the message and FALSE otherwise.
If you return TRUE, you should also set hRet to an appropriate COM error
code (most often S_OK). This code is eventually returned from
IOleInPlaceActiveObject::TranslateAccelerator
> Please tell me the steps to achieve the keyboard accelerators get
processed.
> I dont know when & where to call the TranslateAccelerator API.
From PreTranslateAccelerator. It should be called if you do everything
correctly.
> and how to
> handle the WM_COMMAND Message in ActiveX control.
Just put COMMAND_ID_HANDLER macro into your message map.
> I read about message pump while searching the web and consulting the
msdn.
> it is written there that messaeg pump should be placed in the WinMain.
i
> dont find any relationg of WinMain to the ActiveX Control.
The container runs the message pump for you. You don't need to provide
your own unless you spin worker threads.