ContainerDlg.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // ContainerDlg.cpp: 实现文件
  2. //
  3. #include "pch.h"
  4. #include "DMS.h"
  5. #include "ContainerDlg.h"
  6. #include "afxdialogex.h"
  7. // ContainerDlg 对话框
  8. IMPLEMENT_DYNAMIC(ContainerDlg, CDialogEx)
  9. ContainerDlg::ContainerDlg(CWnd* pParent /*=nullptr*/)
  10. : CDialogEx(IDD_VIEW_CONTAINER, pParent)
  11. {
  12. }
  13. ContainerDlg::~ContainerDlg()
  14. {
  15. }
  16. void ContainerDlg::DoDataExchange(CDataExchange* pDX)
  17. {
  18. CDialogEx::DoDataExchange(pDX);
  19. }
  20. BEGIN_MESSAGE_MAP(ContainerDlg, CDialogEx)
  21. ON_BN_CLICKED(IDOK, &ContainerDlg::OnBnClickedOk)
  22. END_MESSAGE_MAP()
  23. // ContainerDlg 消息处理程序
  24. // CMyDlg message handlers
  25. void ContainerDlg::SetWindowName(LPCTSTR _lpcName)
  26. {
  27. SetDlgItemText(IDC_STATIC_NAME, _lpcName);
  28. }
  29. void ContainerDlg::SetChildHWnd(HWND _hWnd)
  30. {
  31. m_hChildWnd = _hWnd;
  32. CRect rect;
  33. GetWindowRect(rect);
  34. ::SetParent(_hWnd, GetSafeHwnd());
  35. ScreenToClient(rect);
  36. ::MoveWindow(m_hChildWnd, rect.left, rect.top, rect.Width(), rect.Height(), 1);
  37. SetWindowLong(m_hChildWnd, GWL_STYLE, GetWindowLong(m_hChildWnd, GWL_STYLE) & ~WS_CAPTION);
  38. ::ShowWindow(_hWnd, SW_SHOW);
  39. ::SetActiveWindow(_hWnd);
  40. ::InvalidateRect(_hWnd, NULL, 1);
  41. ::UpdateWindow(_hWnd);
  42. //::SetWindowLong(_hWnd, GWL_STYLE, GetWindowLong(_hWnd, GWL_STYLE) &~WS_POPUP | WS_CHILD);
  43. }
  44. void ContainerDlg::OnBnClickedOk()
  45. {
  46. // TODO: Add your control notification handler code here
  47. CDialogEx::OnOK();
  48. }