Показать сообщение отдельно
Старый 11.10.2002, 17:32   #8  
Maxim Gorbunov is offline
Maxim Gorbunov
Administrator
Соотечественники
Лучший по профессии 2009
 
2,483 / 645 (26) +++++++
Регистрация: 27.11.2001
Адрес: Dubai, UAE
Пробился на TechNET!!!!

В одном сообщении про installMessageProc у них в discussions есть интересные слова:
Цитата:
I've got an answer from service system. The method seems to be not usable. It will be correctly implemented in version 3.
Вот так.

А вот другое обсуждение.
Цитата:
This is a classic Axapta problem.
It is as far as I know not possible to override Axapta shortcuts.
The suggested "SysSetupFormRun.task()" approach is not an option for your problem unless you want to use and override the existing Axapta tasks (e.g. New Record, Next Record ...)
The other suggested approach using TDC's DLL used in the SFC module is not an option either. What the DLL do is that it maps the F-keys with the appropiate ALT keys (e.g. F1 = ALT1, F2 = ALT2). Furthermore you can not catch the ALT keys anyway. They need to be Axapta auto generated shotcuts. This can be achieved on bottons but not in your grid.
So if you prefer to use the AFC DLL you need to create a button with a caption that automatically unserlines (auto shortcuts) a number (1 to 9).

I can suggest a possible solution to your problem though:
You need to have an ActiveX control that implements a Windows message hook wich triggers an event whenever a key is pressed. This event you will be able to handle in Axapta.
If you choose to write the ActiveX component yourself remember to forward the messages you hook to the system. Otherwise Axapta will not get the messages.
I also think you might run in to trouble or should I say that you should be aware that a Windows &nbspmessagehook can only take the actual Axapta instance as a parameter and not the Windows handle of your form thus you can only catch messages in Axapta general and not filter it to only be messages directed to your specific form.

If you're not able to write the ActiveX yourself try to find one on the internet.
You can start at http://www.avenir.net/downloads/products/aveactivex.htm
I have not tried it myself but it seems to do almost what you need.

I think in future versions of Axapta we will be able to do catch Windows messages. The class SysSetupFormRun has the methods "messageProc" and "installMessageProc" which do not seem to be fully implemented yet.
Уррра! Вам предлагают решение.

Только вот сам факт того, что его предлагают, кажется, свидетельствует о том, что более простого решения не существует.

Смотрите. Вам решать
__________________
Not registered yet? Register here!
Have comments, questions, suggestions or anything else regarding our web site? Don't hesitate, send them to me