Here is the part code for just seeing under the webpage.
I f you interested to download it's full source code and or just the biner application
please click here to download it...

.
back to http://oocities.com/in2soft {home} or... http://oocities.com/in2soft/download.html {see others}
 
----- #info-{-begin ---- filename
content
----- #info-}-end ----
 
----- #info-{-begin ---- _mfc.h

// _mfc.h : main header file for the _MFC application
//

#if !defined(AFX__MFC_H__B8BB9158_1FEE_4153_9144_52E9BFD414D9__INCLUDED_)
#define AFX__MFC_H__B8BB9158_1FEE_4153_9144_52E9BFD414D9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h" // main symbols

/////////////////////////////////////////////////////////////////////////////
// C_mfcApp:
// See _mfc.cpp for the implementation of this class
//

class C_mfcApp : public CWinApp
{
public:
C_mfcApp();

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(C_mfcApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL

// Implementation

//{{AFX_MSG(C_mfcApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX__MFC_H__B8BB9158_1FEE_4153_9144_52E9BFD414D9__INCLUDED_)


----- #info-}-end ----
 
----- #info-{-begin ---- _mfc.cpp

// _mfc.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "_mfc.h"
#include "_mfcDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// C_mfcApp

BEGIN_MESSAGE_MAP(C_mfcApp, CWinApp)
//{{AFX_MSG_MAP(C_mfcApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// C_mfcApp construction

C_mfcApp::C_mfcApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only C_mfcApp object

C_mfcApp theApp;

/////////////////////////////////////////////////////////////////////////////
// C_mfcApp initialization

BOOL C_mfcApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

C_mfcDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}

// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}


----- #info-}-end ----
 
----- #info-{-begin ---- _mfcDlg.h

// _mfcDlg.h : header file
//

#if !defined(AFX__MFCDLG_H__C7770F25_4A42_4E7A_8166_AFB7135EE7D7__INCLUDED_)
#define AFX__MFCDLG_H__C7770F25_4A42_4E7A_8166_AFB7135EE7D7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// C_mfcDlg dialog

class C_mfcDlg : public CDialog
{
// Construction
public:
C_mfcDlg(CWnd* pParent = NULL); // standard constructor

// Dialog Data
//{{AFX_DATA(C_mfcDlg)
enum { IDD = IDD__MFC_DIALOG };
BOOL m_a;
BOOL m_b;
BOOL m_c;
BOOL m_d;
BOOL m_e;
BOOL m_f;
BOOL m_g;
BOOL m_h;
BOOL m_i;
BOOL m_AllDrv;
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(C_mfcDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
HICON m_hIcon;

// Generated message map functions
//{{AFX_MSG(C_mfcDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnBtnSet();
afx_msg void OnCheck1();
afx_msg void OnCheck2();
afx_msg void OnCheck3();
afx_msg void OnCheck4();
afx_msg void OnCheck5();
afx_msg void OnCheck6();
afx_msg void OnCheck7();
afx_msg void OnCheck8();
afx_msg void OnCheck9();
afx_msg void OnAllDrv();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX__MFCDLG_H__C7770F25_4A42_4E7A_8166_AFB7135EE7D7__INCLUDED_)


----- #info-}-end ----
 
----- #info-{-begin ---- _mfcDlg.cpp

// _mfcDlg.cpp : implementation file
//

#include "stdafx.h"
#include "_mfc.h"
#include "_mfcDlg.h"

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

// This to convert Drive, for now character, well modify it as you need
// to its registry value
// just like PC Hardware Interface, the eq. is iRegistry Value =2^(i)
// the brieve way is,
// drive A = 2^0
// drive B = 2^1
// and, ...
// .....
#include <math.h>
int DrvToNum(CString strDrv) {
// convert it to lower case
int n=0;
char ch;
strDrv.MakeLower();
ch = strDrv.GetAt (0);
switch (ch) {
case 'a':n=0;break; case 'b':n=1;break; case 'c':n=2;break;
case 'd':n=3;break; case 'e':n=4;break; case 'f':n=5;break;
case 'g':n=6;break; case 'h':n=7;break; case 'i':n=8;break;
}
n = (int)pow(2,n);
return (DWORD)n;
}

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// C_mfcDlg dialog

C_mfcDlg::C_mfcDlg(CWnd* pParent /*=NULL*/)
: CDialog(C_mfcDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(C_mfcDlg)
m_a = FALSE;
m_b = FALSE;
m_c = FALSE;
m_d = FALSE;
m_e = FALSE;
m_f = FALSE;
m_g = FALSE;
m_h = FALSE;
m_i = FALSE;
m_AllDrv = FALSE;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void C_mfcDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(C_mfcDlg)
DDX_Check(pDX, IDC_CHECK1, m_a);
DDX_Check(pDX, IDC_CHECK2, m_b);
DDX_Check(pDX, IDC_CHECK3, m_c);
DDX_Check(pDX, IDC_CHECK4, m_d);
DDX_Check(pDX, IDC_CHECK5, m_e);
DDX_Check(pDX, IDC_CHECK6, m_f);
DDX_Check(pDX, IDC_CHECK7, m_g);
DDX_Check(pDX, IDC_CHECK8, m_h);
DDX_Check(pDX, IDC_CHECK9, m_i);
DDX_Check(pDX, IDC_CHECK10, m_AllDrv);
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(C_mfcDlg, CDialog)
//{{AFX_MSG_MAP(C_mfcDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BTNSET, OnBtnSet)
ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
ON_BN_CLICKED(IDC_CHECK3, OnCheck3)
ON_BN_CLICKED(IDC_CHECK4, OnCheck4)
ON_BN_CLICKED(IDC_CHECK5, OnCheck5)
ON_BN_CLICKED(IDC_CHECK6, OnCheck6)
ON_BN_CLICKED(IDC_CHECK7, OnCheck7)
ON_BN_CLICKED(IDC_CHECK8, OnCheck8)
ON_BN_CLICKED(IDC_CHECK9, OnCheck9)
ON_BN_CLICKED(IDC_CHECK10, OnAllDrv)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// C_mfcDlg message handlers

BOOL C_mfcDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
}

void C_mfcDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void C_mfcDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR C_mfcDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}

void C_mfcDlg::OnBtnSet()
{
HKEY hkDrv;
LONG lResult;
TCHAR szSubK[MAX_PATH]="";
strcpy(szSubK,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");

DWORD dwData;

UCHAR szBuf[80]="string";

// is check==true ???
dwData = 0;
if (m_a) dwData = dwData+DrvToNum('a');if (m_b) dwData = dwData+DrvToNum('b');if (m_c) dwData = dwData+DrvToNum('c');
if (m_d) dwData = dwData+DrvToNum('d');if (m_e) dwData = dwData+DrvToNum('e');if (m_f) dwData = dwData+DrvToNum('f');
if (m_g) dwData = dwData+DrvToNum('g');if (m_h) dwData = dwData+DrvToNum('h');if (m_i) dwData = dwData+DrvToNum('i');
// etc .....
if (m_AllDrv) dwData=(DWORD)pow(2,26);

lResult = RegOpenKeyEx( HKEY_CURRENT_USER, _T(szSubK), 0, KEY_ALL_ACCESS, &hkDrv );
if( lResult == ERROR_SUCCESS ) {
// if success, open the value
//MessageBox("hkDrv Success","java.9f.com",MB_OK);
// utk string
//lResult = RegSetValueEx(hkDrv, "NoDrives", 0, REG_DWORD, LPBYTE(szBuf), 4);
// utk dword
lResult = RegSetValueEx(hkDrv, "NoDrives", 0, REG_DWORD, (LPBYTE) &dwData , sizeof(DWORD));
if(lResult == ERROR_SUCCESS) {
// if success
MessageBox("please, notice that you must\nrefresh your explorer\nor you may restart your computer\n\n\nwell, that's all is to make sure it's work.","oocities.com/in2soft",MB_OK);
}
}

RegCloseKey(hkDrv);
}

void C_mfcDlg::OnCheck1()
{
m_a = !m_a;
}

void C_mfcDlg::OnCheck2()
{
m_b = !m_b;
}

void C_mfcDlg::OnCheck3()
{
m_c = !m_c;
}

void C_mfcDlg::OnCheck4()
{
m_d = !m_d;
}

void C_mfcDlg::OnCheck5()
{
m_e = !m_e;
}

void C_mfcDlg::OnCheck6()
{
m_f = !m_f;
}

void C_mfcDlg::OnCheck7()
{
m_g = !m_g;
}

void C_mfcDlg::OnCheck8()
{
m_h = !m_h;
}

void C_mfcDlg::OnCheck9()
{
m_i = !m_i;
}

void C_mfcDlg::OnAllDrv()
{
m_AllDrv = !m_AllDrv;
}

void C_mfcDlg::OnOK()
{
ShellExecute(NULL,"open","explorer.exe","http://oocities.com/in2soft",NULL,SW_SHOW);
}


----- #info-}-end ----
 

Here is the part code for just seeing under the webpage.
I f you interested to download it's full source code and or just the biner application
please click here to download it...

.
back to http://oocities.com/in2soft {home} or... http://oocities.com/in2soft/download.html {see others}
 
in2soft | Software | Webdesaign | Services | Contact
Copyright © 1999-2004 Salvasi Software
http://oocities.com/in2soft