|
/**
* @name MakeDirDlg.cpp
* @purpose Make directory-dialog
* @date 5 May 2003
* @author S.Deckers
*/
#include "stdafx.h"
#include "MakeDirDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMakeDirDlg dialog
/**
* @name OnOk
* @Purpose OnOk messagehandler
*/
LRESULT CMakeDirDlg::OnOk( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
TCHAR szDir[ MAX_PATH];
TCHAR szFullPath[ MAX_PATH];
SendMessage( WM_GETTEXT, sizeof(szDir)/sizeof(TCHAR), (LPARAM)(void*)szDir);
HWND hWnd = GetDlgItem( IDC_EDIT1);
::GetWindowText( hWnd, szDir, MAX_PATH);
wsprintf( szFullPath, "%s\\%s", m_szParent, szDir);
if( !::CreateDirectory( (LPCTSTR) szFullPath, NULL))
{
TCHAR szErr[ MAX_PATH];
wsprintf( szErr, "Error creating directory [%s]", szFullPath);
MessageBox( szErr, "MakeDir", MB_OK | MB_ICONERROR);
}
EndDialog( wID);
return( 0);
}
/**
* @name OnCancel
* @Purpose OnCancel messagehandler
*/
LRESULT CMakeDirDlg::OnCancel( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
EndDialog( wID);
return( 0);
}
/**
* @name CMakeDir::OnInitDialog
* @purpose OnInitDialog messagehandler
*/
LRESULT CMakeDirDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
CenterWindow( m_pCmdInfo->hwnd);
ShowWindow( SW_SHOW);
//::EnableWindow( GetDlgItem ( IDOK), TRUE);
//::SetFocus( GetDlgItem ( IDC_EDIT1));
//SendDlgItemMessage( IDC_EDIT1, WM_SETFOCUS, wParam, lParam);
//::SetActiveWindow( GetDlgItem ( IDC_EDIT1));
//SendDlgItemMessage( IDC_EDIT1, WM_ACTIVATE, wParam, lParam);
return( TRUE); // return TRUE unless you set the focus to a control
}
|
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.