home *** CD-ROM | disk | FTP | other *** search
- //
- // TrueDic Beispiel
- //
- #include <afxwin.h>
- #include <afxdlgs.h>
- #include <afxext.h>
- #include "resource.h"
- #include "resrc1.h"
- #include "trdedic.h"
-
-
- #define BOOK_ENGLISH 1 // englisches W÷rterbuch
- #define BOOK_GERMAN 2 // deutsches W÷rterbuch
-
-
- extern "C" BOOL FAR PASCAL ShowTrueDic(LPSTR lpCmdLine, BOOL iCmdLine, BOOL iBook, BOOL bReserved);
-
-
- /////////////////////////////////////////////////////////////////////////////
- // ThisApp:
- /////////////////////////////////////////////////////////////////////////////
- CTruedicApp ThisApp;
-
- /////////////////////////////////////////////////////////////////////////////
- // InitInstance:
- /////////////////////////////////////////////////////////////////////////////
- BOOL CTruedicApp::InitInstance()
- {
-
- m_pMainWnd = new CMainDlgWindow();
- m_pMainWnd->Invalidate(TRUE);
- m_pMainWnd->ShowWindow(SW_SHOW);
-
- SetClassWord(m_pMainWnd->m_hWnd,GCW_HICON, (WORD)LoadIcon(AFX_IDI_STD_FRAME));
-
- return TRUE;
- }
-
- //-----------------------------------------------------------------------
- // CMainDlgWindow constructor:
- // Create the dialog box using the definition in the dialog template
- //-----------------------------------------------------------------------
- CMainDlgWindow::CMainDlgWindow()
- {
- Create(MAIN_DICTIONARY); // Create the Main Dialog Window
- }
-
-
- void CMainDlgWindow::OnClose()
- {
- DestroyWindow(); // Destroy the dialog box window
- delete this; // Delete 'this' dialog box object
- PostQuitMessage(0); // End the application
- }
-
-
- BEGIN_MESSAGE_MAP(CMainDlgWindow, CDialog)
- //{{AFX_MSG_MAP(CMainDlgWindow)
- ON_WM_CLOSE()
- ON_COMMAND(ID_EXIT, OnExit)
- ON_BN_CLICKED(IDC_DEUENG, OnDeueng)
- ON_BN_CLICKED(IDC_ENGDEU, OnEngdeu)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- void CMainDlgWindow::OnExit()
- {
- OnClose(); // Do the OnClose member function
- }
-
- void CMainDlgWindow::OnDeueng()
- {
-
- BOOL iCmd = TRUE; // ctl3d an
- BOOL iBook = BOOK_GERMAN;
- CString cStr;
-
- LPSTR lpStwWort = cStr.GetBuffer(30);
-
- GetDlgItemText(IDC_STICHWORT, lpStwWort,30);
-
- ShowTrueDic((LPSTR)lpStwWort, iCmd, iBook, 0);
-
- }
-
- void CMainDlgWindow::OnEngdeu()
- {
-
- BOOL iCmd = TRUE; // ctl3d an
- BOOL iBook = BOOK_ENGLISH; // deutsches W÷rterbuch
- CString cStr;
-
- LPSTR lpStwWort = cStr.GetBuffer(30);
-
- GetDlgItemText(IDC_STICHWORT, lpStwWort,30);
-
- ShowTrueDic((LPSTR)lpStwWort, iCmd, iBook, 0);
-
- }
-
- BOOL CMainDlgWindow::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_cBitEng.AutoLoad(IDC_ENGDEU, this);
- m_cBitDeu.AutoLoad(IDC_DEUENG, this);
-
- m_cBitDeu.SizeToContent();
- m_cBitEng.SizeToContent();
-
- // horizontal
-
- SetWindowPos(&wndTopMost, 0, 0, 42, 20, 0);
-
- m_cBitEng.SetWindowPos(0, 0, 0, 0, 0, SWP_NOSIZE);
- m_cBitDeu.SetWindowPos(0, 21, 0, 0, 0, SWP_NOSIZE);
-
-
- // senkrecht
- /*
- SetWindowPos(&wndTopMost, 0, 0, 21, 40, 0);
-
- m_cBitDeu.SetWindowPos(0, 0, 0, 0, 0, SWP_NOSIZE);
- m_cBitEng.SetWindowPos(0, 0, 20, 0, 0, SWP_NOSIZE);
- */
-
- return TRUE; // return TRUE unless you set the focus to a control
- }
-