- // NPDoc.cpp : implementation of the CNPDoc class
- //
- #include "stdafx.h"
- #include "NoPassword.h"
- #include "NPDoc.h"
- #include "NewTarget.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CNPDoc
- IMPLEMENT_DYNCREATE(CNPDoc, CDocument)
- BEGIN_MESSAGE_MAP(CNPDoc, CDocument)
- //{{AFX_MSG_MAP(CNPDoc)
- ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_THREAD, OnReleasedCaptureThread)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CNPDoc construction/destruction
- CNPDoc::CNPDoc()
- {
- // TODO: add one-time construction code here
- }
- CNPDoc::~CNPDoc()
- {
- }
- BOOL CNPDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
- CNewTarget dlg;
- if(dlg.DoModal() == IDOK)
- {
- m_nFrom = dlg.m_nFrom;
- m_nTo = dlg.m_nTo;
- m_Host = dlg.m_Host;
- m_User = dlg.m_User;
- }
- else
- {
- m_nFrom = 0;
- m_nTo = 9999999;
- m_Host = "pop.unknown.com";
- m_User = "Noname";
- }
- m_nResult = -1;
- m_nMaxThreads = 50;
- m_nCurrent = m_nFrom;
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CNPDoc serialization
- void CNPDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- ar<<m_Host;
- ar<<m_nCurrent;
- ar<<m_nFrom;
- ar<<m_nMaxThreads;
- ar<<m_nResult;
- ar<<m_nTo;
- ar<<m_User;
- }
- else
- {
- // TODO: add loading code here
- ar>>m_Host;
- ar>>m_nCurrent;
- ar>>m_nFrom;
- ar>>m_nMaxThreads;
- ar>>m_nResult;
- ar>>m_nTo;
- ar>>m_User;
- }
- }
- /////////////////////////////////////////////////////////////////////////////
- // CNPDoc diagnostics
- #ifdef _DEBUG
- void CNPDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
- void CNPDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CNPDoc commands
- void CNPDoc::OnReleasedCaptureThread(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- CSliderCtrl slider;
- slider.Attach(pNMHDR->hwndFrom);
- InterlockedExchange(&m_nMaxThreads,slider.GetPos());
- slider.Detach();
- *pResult = 0;
- }