Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX keyboard support in WIN32 app

Status
Not open for further replies.

hzenz

Programmer
Nov 23, 2009
1
DE
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?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top