Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.2 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 19/04/2000
  5. // Last modification: 08/10/2003
  6. // Project Intruder Position Indicator
  7. // SUBSYSTEM: MessageDlg
  8. // FILE: MessageDlg.cpp
  9. // AUTHOR: Chizhevskiy Sergey
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of class CMessageDlg
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "..\LgLib\Version.h"
  16. #include "MessageDlg.h"
  17. CMessageDlg::CMessageDlg()
  18. {
  19. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CMessageDlg::CMessageDlg" );
  20. }
  21. CMessageDlg::~CMessageDlg()
  22. {
  23. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CMessageDlg::~CMessageDlg" );
  24. }
  25. BOOL CALLBACK WndProcMessageDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
  26. {
  27. static CMessageDlg *self = NULL;
  28. switch(uMsg)
  29. {
  30. case WM_INITDIALOG:
  31. self = (CMessageDlg*)lParam;
  32. break;
  33. default:
  34. if(self)
  35. return self->OnMessage(hwndDlg, uMsg, wParam, lParam);
  36. }
  37. return FALSE;
  38. }
  39. BOOL CMessageDlg::Create(HWND hParentWnd, LPPOINT pPoint, LPSIZE pSize)
  40. {
  41. m_hWnd = ::CreateDialogParam((HINSTANCE)::GetWindowLong(hParentWnd, GWL_HINSTANCE),
  42. MAKEINTRESOURCE(IDD_MESSAGE_DLG), hParentWnd,
  43. WndProcMessageDlg, (LPARAM)this);
  44. POINT p = { 10, 533 };
  45. if (pPoint)
  46. p = *pPoint;
  47. SIZE s = { 384, 200 };
  48. if (pSize)
  49. s = *pSize;
  50. // ::SetWindowPos(m_hWnd, HWND_TOP, p.x, p.y, s.cx, s.cy, SWP_SHOWWINDOW | SWP_NOSIZE);
  51. ::SetWindowPos(m_hWnd, HWND_TOP, p.x, p.y, s.cx, s.cy, SWP_HIDEWINDOW | SWP_NOSIZE);
  52. return TRUE;
  53. }
  54. HWND CMessageDlg::GetItemHWND() const // 23/04/2001
  55. {
  56. return GetDlgItem(m_hWnd, IDC_STATIC_CONNECTION);
  57. }
  58. BOOL CMessageDlg::OnMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
  59. {
  60. return FALSE;
  61. }
  62. void CMessageDlg::SetWindowText(LPCTSTR pStr )
  63. {
  64. ::SendDlgItemMessage(m_hWnd, IDC_STATIC_MESSAGE_TEXT, WM_SETTEXT, 0, (LPARAM)pStr);
  65. }
  66. void CMessageDlg::SetTimeText(LPCTSTR pStr) const
  67. {
  68. ::SendDlgItemMessage(m_hWnd, IDC_STATIC_MESSAGE_TIME, WM_SETTEXT, 0, (LPARAM)pStr);
  69. }