I have to embed an ActiveX control into an simple WIN32 app. The parent window is created with CreateWindow() and the control - a MS Flex Grid Control - is embedded with the following code (ATL):
#import "../msflxgrd.ocx"
using namespace MSFlexGridLib;
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
....
_Module.Init(NULL, hInstance);
AtlAxWinInit();
...
}
atlWndClassName = CAxWindow2::GetWndClassName();
axctrl = ::CreateWindow(atlWndClassName,
_T("{6262d3a0-531b-11cf-91f6-c2863c385e30}"),
WS_CHILD, 310, 10, 300, 300,
(HWND)hWndParent, (HMENU)10, hInst, NULL);
ShowWindow(axctrl, SW_SHOW);
UpdateWindow(axctrl);
Everything works fine with this example, but it is not possible to move from cell to cell with the arrow keys. When i connect Spy++ to the application, i can see, that WM_KEYDOWN and WM_KEYUP messages are sent to the Flex Grid Control. The same problem exists with the MS Calendar Control.
When these controls are embedded into the Microsoft ActiveX Control Test Container or into a MFC-Dialogbox the keyboard control works fine.
Has someone an idea, what code is necessary to support keyboard control for ActiveX controls in simple WIN32 apps?
#import "../msflxgrd.ocx"
using namespace MSFlexGridLib;
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
....
_Module.Init(NULL, hInstance);
AtlAxWinInit();
...
}
atlWndClassName = CAxWindow2::GetWndClassName();
axctrl = ::CreateWindow(atlWndClassName,
_T("{6262d3a0-531b-11cf-91f6-c2863c385e30}"),
WS_CHILD, 310, 10, 300, 300,
(HWND)hWndParent, (HMENU)10, hInst, NULL);
ShowWindow(axctrl, SW_SHOW);
UpdateWindow(axctrl);
Everything works fine with this example, but it is not possible to move from cell to cell with the arrow keys. When i connect Spy++ to the application, i can see, that WM_KEYDOWN and WM_KEYUP messages are sent to the Flex Grid Control. The same problem exists with the MS Calendar Control.
When these controls are embedded into the Microsoft ActiveX Control Test Container or into a MFC-Dialogbox the keyboard control works fine.
Has someone an idea, what code is necessary to support keyboard control for ActiveX controls in simple WIN32 apps?