10-24-2005 08:08 AM
cls.cbSize = sizeof(WNDCLASSEX);//register class
cls.style = CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
cls.lpfnWndProc = ((WNDPROC)WIN_PROCESS_CALIBRATION);
cls.cbClsExtra = 0;
cls.cbWndExtra = 0;
cls.hInstance = getInstanceHandle();
cls.hIcon = NULL;
cls.hCursor = LoadCursor(getCameraPtr()->getInstanceHandle(), IDC_CROSS);
cls.hbrBackground = NULL;
cls.lpszMenuName = (LPCSTR)NULL;
cls.lpszClassName = "A name";
cls.hIconSm = NULL;
atomClass = RegisterClassEx(&cls);
and then put the child window on a cvi panel:
GetPanelAttribute(m_iPanel, ATTR_SYSTEM_WINDOW_HANDLE, &hWnd);
m_hDisplayArea = CreateWindow("A name", WS_CHILD|WS_VISIBLE, iLeft, iTop, iWidth, iHeight, hWnd, NULL, NULL, NULL);
of course I have a static function for the child window message processing:
switch (message)LRESULT CALLBACK WIN_PROCESS_CALIBRATION(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
{
case WM_COMMAND: break; case WM_PAINT:hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...EndPaint(hWnd, &ps);
break; case WM_DESTROY: break; default: return DefWindowProc(hWnd, message, wParam, lParam);}
return 0;}
then I display parent panel and the child window: DisplayPanel(m_iPanel), OK, works! child window receicve message and you can fill in code under //todo line to show what you want on the child window.
then I change another way to show panel, InstallPopup(m_iPanel). failed! child window processing function WIN_PROCESS_CALIBRATION is never be visited!
who can tell me how to solve the problem while I really need a modal dialog.
thanks advance!
10-24-2005 11:40 AM
10-25-2005 01:33 AM
thanks!
it does work!!