abhijit123
Programmer
I am developed a dialog as a MFC DLL which i am invoking through a another application viz. Unigraphics. For the event of one of button clicks I want to open a sub-menu from parent window(unigraphics). The key short cut for it is Ctl + M or Alt + N + M.
The first option is not working through SendMessage.
However in second case if I use SendMessage with message as WM_SYSCOMMAND type,wParam as SC_KEYMENU and lParam as 'N', the Alt + N functionality is executed. But M keystroke is not getting synthesized.
Code: -
SendMessage(hWndUG,WM_SYSCOMMAND ,SC_KEYMENU,'n');
SendMessage(hWndUG,WM_KEYDOWN,0x4D,0);
SendMessage(hWndUG,WM_KEYUP,0x4D,0);
On non-mfc applications do only WM_SYSCOMMAND messages work? How do I sysnthesize non-system keys(without alt).
I tried keybd_event too without success. Currently for temporary purpose I am using a exe generated from Visual Basic. It works fine but it is a very crude way of performing this task. The VB code is:
Private Sub Form_Load()
AppActivate "Unigraphics"
SendKeys "%"
SendKeys "{N}"
SendKeys "{M}
Unload Me
End Sub
In VB too Ctl + M doesn't work. can anyone suggest a good solution!
The first option is not working through SendMessage.
However in second case if I use SendMessage with message as WM_SYSCOMMAND type,wParam as SC_KEYMENU and lParam as 'N', the Alt + N functionality is executed. But M keystroke is not getting synthesized.
Code: -
SendMessage(hWndUG,WM_SYSCOMMAND ,SC_KEYMENU,'n');
SendMessage(hWndUG,WM_KEYDOWN,0x4D,0);
SendMessage(hWndUG,WM_KEYUP,0x4D,0);
On non-mfc applications do only WM_SYSCOMMAND messages work? How do I sysnthesize non-system keys(without alt).
I tried keybd_event too without success. Currently for temporary purpose I am using a exe generated from Visual Basic. It works fine but it is a very crude way of performing this task. The VB code is:
Private Sub Form_Load()
AppActivate "Unigraphics"
SendKeys "%"
SendKeys "{N}"
SendKeys "{M}
Unload Me
End Sub
In VB too Ctl + M doesn't work. can anyone suggest a good solution!