5],stringup1[255],stringup2[255];icapacity,icapacity1,icapacity2,,ienergy1,ienergy2,,ipower1,ipower2;CSName1,CSName2;sourceDC;:OnInitDialog();OnUp();_msg void OnPaint (); (UINT id, CWnd * Owner): CDialog (id, Owner) {}; _MESSAGE_MAP ()
}; CDialogHelp: public CDialog {: * lb;: OnInitDialog (); (UINT id, CWnd * Owner): CDialog (id, Owner) {};
};
/ / App.cpp
# include «App.h» rec; m_db; Data rec1; resultAutorization=0; root; CApp :: InitInstance () {brush (RGB (255,255,255)); adb (IDD_DIALOG1, m_pMainWnd) ;. DoModal (); winStyle=AfxRegisterWndClass (0, LoadStandardCursor (IDC_ARROW), brush, LoadStandardIcon (IDI_WINLOGO)); _pMainWnd=new CMainWindow(winStyle);_pMainWnd->ShowWindow(m_nCmdShow);_pMainWnd->UpdateWindow();(resultAutorization == 0) m_pMainWnd-> DestroyWindow (); TRUE;} :: CMainWindow (LPCSTR winStyle) {(winStyle, «Інформаційно-пошукова система 4aData», WS_MAXIMIZE, rectDefault);_menu.LoadMenuA(IDR_MENU1);(&my_menu);();();}CMainWindow::OnPaint(){sourceDC;targetDC(this);.CreateCompatibleDC(&targetDC);.LoadBitmapA(IDB_BITMAP1);.SelectObject(&bmp1);.BitBlt(300,150,400,300,&sourceDC,0,0,SRCCOPY);
}_MESSAGE_MAP(CMainWindow,CFrameWnd)_COMMAND(ID_FILE_OPEN40001,OnOpen)_COMMAND(ID_FILE_CLOSE40002,OnClose)_COMMAND(ID_40003,OnForget)_COMMAND(ID_APP_ABOUT,OnAUsers)_COMMAND(ID_BUTTON40008,OnOpen)_COMMAND(ID_BUTTON40009,OnClose)_COMMAND(ID_BUTTON40010,OnHelp)_COMMAND(ID_40011,OnGraf)_COMMAND(ID_BUTTON40012,OnGraf)_COMMAND(ID_BUTTON40013,OnAUsers)_COMMAND(ID_40014,OnHelp)_WM_CLOSE(OnClose)_WM_PAINT()_WM_SIZE()_NOTIFY_RANGE(TTN_NEEDTEXT,0,IDR_TOOLBAR1,OnTTip)_MESSAGE_MAP()CMainWindow::OnGraf(){gf(IDD_DIALOG4,this);.DoModal();
} CMainWindow :: OnHelp () {CDialogHelp help (IDD_DIALOG5, this); help.DoModal ();} CMainWindow :: OnSize (UINT How, int Width, int Height) {/ / m_TB.AutoSize ();
}CMainWindow::OnShow(){m_TB.ShowWindow(SW_RESTORE);}CMainWindow::OnHide(){m_TB.ShowWindow(SW_HIDE);}CMainWindow::InitToolBar(){r;.left =R.top=r.right=r.bottom=0;_TB.Create(WS_VISIBLE|WS_CHILD|WS_BORDER|TBSTYLE_TOOLTIPS,r,this,IDR_TOOLBAR1);tbButton[5];[0].iBitmap=0;[0].idCommand=ID_BUTTON40008;[0].fsState =TBSTATE_ENABLED; [0]. FsStyle=TBSTYLE_BUTTON; [0]. DwData=0; [0]. IString=0; [1]. IBitmap=1; [1]. IdCommand=ID_BUTTON40009; [1]. FsState=TBSTATE_ENABLED ; [1]. fsStyle=TBSTYLE_BUTTON; [1]. dwData=0; [1]. iString=0; [2]. iBitmap=2; [2]. idCommand=ID_BUTTON40010; [2]. fsState=TBSTATE_ENABLED; [ 2]. fsStyle=TBSTYLE_BUTTON; [2]. dwData=0; [2]. iString=0; [3]. iBitmap=3; [3]. idCommand=ID_BUTTON40012; [3]. fsState=TBSTATE_ENABLED; [3] . fsStyle=TBSTYLE_BUTTON; [3]. dwData=0; [3]. iString=0; [4]. iBitmap=4; [4]. idCommand=ID_BUTTON40013; [4]. fsState=TBSTATE_ENABLED; [4]. fsStyle =TBSTYLE_BUTTON; [4]. dwData=0; [4]. iString=0; _TB.AddButtons (5, tbButton); _TB.AddBitmap (5, IDR_TOOLBAR1);
} CMainWindow :: OnTTip (UINT idNotUsed, NMHDR * hdr, LRESULT * ResultNotUsed) {(hdr-> idFrom)
{ID_BUTTON40008:
((TOOLTIPTEXT *) hdr) -> lpszText="Відкрити"; break; ID_BUTTON40009:
((TOOLTIPTEXT *) hdr) -> lpszText="Вихід"; break; ID_BUTTON40010:
((TOOLTIPTEXT *) hdr) -> lpszText=«Допомога»; break; ID_BUTTON40012: