Click here to Skip to main content
15,884,298 members
Articles / Programming Languages / C++

sdeExtensions: Some shell extensions to make a developer's life easier

Rate me:
Please Sign up or sign in to vote.
4.17/5 (5 votes)
1 Nov 2004CPOL3 min read 41.3K   962   18  
Shell extensions to make a file read/write, make a file readonly, make a new folder, clean up temporary files and MP3 assignment.
/**
 * @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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Merkator
Netherlands Netherlands
Busy with Intergraph G/Technology-GIS

Comments and Discussions