Click here to Skip to main content
15,896,154 members
Articles / Desktop Programming / MFC

QuickWin - Turn a Console Application into a Windows Program

Rate me:
Please Sign up or sign in to vote.
4.83/5 (51 votes)
17 Oct 2000 539.1K   13.1K   230  
Redirect stdin, stdout and stderr into a window
QuickWin is a very useful program to spawn script programs or console applications in a Windows environment without opening a DOS box. In this article, you will see how QuickWin works.
// LppDlg.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"
#include "LppDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CLinePerPageDlg dialog

CLinePerPageDlg::CLinePerPageDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CLinePerPageDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLinePerPageDlg)
	m_bPastToSize = FALSE;
	m_nMaxLine = 0;
	//}}AFX_DATA_INIT
}

void CLinePerPageDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLinePerPageDlg)
	DDX_Check(pDX, IDC_LINE_PAST_TO_SIZE, m_bPastToSize);
	DDX_Text(pDX, IDC_LINE_PER_PAGE, m_nMaxLine);
	//}}AFX_DATA_MAP
	CEdit *pEdit = (CEdit*)GetDlgItem(IDC_LINE_PER_PAGE);
	if (pEdit) pEdit->SetReadOnly(m_bPastToSize);
}

BEGIN_MESSAGE_MAP(CLinePerPageDlg, CDialog)
	//{{AFX_MSG_MAP(CLinePerPageDlg)
	ON_BN_CLICKED(IDC_LINE_PAST_TO_SIZE, OnLinePastToSize)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLinePerPageDlg message handlers

void CLinePerPageDlg::OnLinePastToSize() 
{
	UpdateData(TRUE);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions