I share the project, because I am a bit tired / stuck, no debug This is a hell of trial and error.
I hope it will encourage more people to develop a self-loader and open source.
CODE
//--------------------------------------------------------------------------------------
// Loader Beta
// by SPlNeTe
//
// Thanks to Ski-lleR for your code
//--------------------------------------------------------------------------------------
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
/*
List of physical drive
"\\Device\\Flash"
"\\Device\\Mu1"
"\\Device\\Mu0"
"\\Device\\Cdrom0"
"\\Device\\Harddisk0\\Partition0"
"\\Device\\Harddisk0\\Partition1"
"\\Device\\Harddisk0\\Partition2"
"\\Device\\Harddisk0\\Partition3"
"\\Device\\Mass0"
"\\Device\\Mass1"
"\\Device\\Mass2"
*/
#define DEVICE_NAND_FLASH 0
#define DEVICE_MEMORY_UNIT0 1
#define DEVICE_MEMORY_UNIT1 2
#define DEVICE_CDROM0 3
#define DEVICE_HARDISK0_PART0 4
#define DEVICE_HARDISK0_PART1 5
#define DEVICE_HARDISK0_PART2 6
#define DEVICE_HARDISK0_PART3 7
#define DEVICE_USB0 8
#define DEVICE_USB1 9
#define DEVICE_USB2 10
typedef struct _STRING {
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
} STRING;
// Follow the white rabbit ^^
extern "C" int __stdcall ObCreateSymbolicLink( STRING*, STRING*);
extern "C" int __stdcall ObDeleteSymbolicLink( STRING* );
HRESULT Monter( int periphPhys, char* lettreLecteur )
{
char lecteurCible[16];
sprintf_s(lecteurCible,"\\??\\%s", lettreLecteur );
char * periphOriginal;
switch( periphPhys )
{
case DEVICE_NAND_FLASH:
periphOriginal = "\\Device\\Flash";
break;
case DEVICE_MEMORY_UNIT0:
periphOriginal = "\\Device\\Mu0";
break;
case DEVICE_MEMORY_UNIT1:
periphOriginal = "\\Device\\Mu1";
break;
case DEVICE_CDROM0:
periphOriginal = "\\Device\\Cdrom0";
break;
case DEVICE_HARDISK0_PART0:
periphOriginal = "\\Device\\Harddisk0\\Partition0";
break;
case DEVICE_HARDISK0_PART1:
periphOriginal = "\\Device\\Harddisk0\\Partition1";
break;
case DEVICE_HARDISK0_PART2:
periphOriginal = "\\Device\\Harddisk0\\Partition2";
break;
case DEVICE_HARDISK0_PART3:
periphOriginal = "\\Device\\Harddisk0\\Partition3";
break;
case DEVICE_USB0:
periphOriginal = "\\Device\\Mass0";
break;
case DEVICE_USB1:
periphOriginal = "\\Device\\Mass1";
break;
case DEVICE_USB2:
periphOriginal = "\\Device\\Mass2";
break;
}
STRING PeriphOriginal = { strlen( periphOriginal ), strlen( periphOriginal ) + 1, periphOriginal };
STRING LienSymbolique = { strlen( lecteurCible ), strlen( lecteurCible ) + 1, lecteurCible };
return ( HRESULT )ObCreateSymbolicLink( &LienSymbolique, &PeriphOriginal );
}
HRESULT Demonter( char* lettreLecteur )
{
char lecteurCible[16];
sprintf_s( lecteurCible,"\\??\\%s", lettreLecteur );
STRING LienSymbolique = { strlen(lecteurCible), strlen(lecteurCible) + 1, lecteurCible };
return ( HRESULT )ObDeleteSymbolicLink( &LienSymbolique );
}
//--------------------------------------------------------------------------------------
// Scene implementation class.
//--------------------------------------------------------------------------------------
class CMyMainScene : public CXuiSceneImpl
{
protected:
// Control and Element wrapper objects.
CXuiTextElement m_text1;
CXuiTextElement m_text2;
CXuiList m_list1;
CXuiList m_list2;
CXuiList m_list3;
CXuiImageElement m_image1;
CXuiScrollBar m_scrollBar1;
CXuiProgressBar m_progressBar1;
CXuiElement m_button1;
string sDirAct;
string sSelectedFiles[1000];
#define COPY 0
#define CUT 1
#define DEL 2
int iManagerOption;
// Message map.
XUI_BEGIN_MSG_MAP()
XUI_ON_XM_INIT( OnInit )
XUI_ON_XM_NOTIFY_PRESS( OnNotifyPress )
XUI_ON_XM_KEYDOWN( OnKeyDown )
XUI_END_MSG_MAP()
//----------------------------------------------------------------------------------
// Performs initialization tasks - retreives controls.
//----------------------------------------------------------------------------------
HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
{
// Retrieve controls for later use.
GetChildById( L"XuiText1", &m_text1 );
GetChildById( L"XuiText2", &m_text2 );
GetChildById( L"XuiCommonList1", &m_list1 );
GetChildById( L"XuiCommonList2", &m_list2 );
GetChildById( L"XuiCommonList3", &m_list3 );
GetChildById( L"XuiImage1", &m_image1 );
GetChildById( L"XuiScrollBar1", &m_scrollBar1 );
GetChildById( L"XuiProgressBar1", &m_progressBar1 );
GetChildById( L"XuiButton1", &m_button1 );
// Montamos los dispositivos
// if (ERROR_SUCCESS == Monter(DEVICE_CDROM0, "dvd0:"))
// m_list1.DeleteItems(3, 1);
Monter(DEVICE_CDROM0, "dvd0:");
Monter(DEVICE_USB0, "usb0:");
Monter(DEVICE_HARDISK0_PART1, "hdd1:");
Monter(DEVICE_NAND_FLASH, "flash:");
//Oculta los elementos inecesarios
m_list3.SetOpacity(0);
m_text2.SetOpacity(0);
m_progressBar1.SetOpacity(0);
m_button1.SetOpacity(0);
//Enfoca la lista de dispositivos
m_list1.SetFocus(XUSER_INDEX_ANY);
return S_OK;
}
//----------------------------------------------------------------------------------
// Handler for the button press message.
//----------------------------------------------------------------------------------
HRESULT OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
{
LPSTR fileName = new char[MAX_PATH];
LPSTR fullPath = new char[MAX_PATH];
LPSTR device = new char[MAX_PATH];
// Si se ha pulsado un boton de la lista de dispositivos
if( hObjPressed == m_list1 )
{
bHandled = TRUE;
//Se convierte el nombre del dispositivo a caracteres anchos
::WideCharToMultiByte( CP_ACP, NULL,m_list1.GetText(m_list1.GetCurSel()), -1, device,MAX_PATH,NULL,NULL );
//Se ocualta la lista de dispositivos
m_list1.SetOpacity(0);
//Se muestra el dispositivo seleccionado
OpenDevice(device);
}
// Si se ha pulsado un boton de la lista de ficheros
else if( hObjPressed == m_list2 )
{
bHandled = TRUE;
//Añade una barra al directorio actual
sDirAct+="\\";
//Convierte el nombre del fichero a caracteres
::WideCharToMultiByte(CP_ACP,NULL,m_list2.GetText(m_list2.GetCurSel()),-1,fileName,MAX_PATH,NULL,NULL);
//Añade el nombre del fichero al directorio Actual
sDirAct+= fileName;
//Copia el sDirAct al puntero directorio
sDirAct._Copy_s(fullPath, sDirAct.length(),sDirAct.length());
//Añade el final del fichero
fullPath[sDirAct.length()]='\0';
//Si el fichero seleccionado es un directorio
if(FILE_ATTRIBUTE_DIRECTORY == GetFileAttributes(fullPath))
{
//Abre el directorio
OpenDevice(fullPath);
}
else
//Si es un fichero
{
//Se comprueba si es un ejecutable
string str = fileName;
if (str.find(".xex")!=string::npos)
{
//Se lanza el ejecutable
XLaunchNewImage(fullPath, NULL);
}
}
}
// Si se ha pulsado un boton de la lista de opciones de ficheros
else if( hObjPressed == m_list3 )
{
bHandled = TRUE;
//Si se ha seccionado "Copiar"
if (m_list3.GetCurSel()==0)
{
iManagerOption = COPY;
SelectCheckedFiles();
}
//Si se ha seccionado "Cortar"
else if (m_list3.GetCurSel()==1)
{
iManagerOption = CUT;
SelectCheckedFiles();
}
//Si se ha seccionado "Pegar"
else if (m_list3.GetCurSel()==2)
{
PasteFiles();
}
//Si se ha seccionado "Borrar"
else if (m_list3.GetCurSel()==3)
{
iManagerOption = DEL;
SelectCheckedFiles();
DeleteFiles();
}
//Si se ha seccionado "Crear"
else if (m_list3.GetCurSel()==4)
{
m_text1.SetText(L"Crear");
CreateDir();
}
//Se oculta la lista de opciones
m_list3.SetOpacity(0);
//Se enfoca la lista de ficheros
m_list2.SetFocus(XUSER_INDEX_ANY);
}
return S_OK;
}
//----------------------------------------------------------------------------------
// Handler for the button press message.
//----------------------------------------------------------------------------------
HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled)
{
string str;
CXuiControl ItemCtrl1;
CXuiControl ItemCtrl2;
CXuiControl ItemCtrl3;
// Recuperamos los botones seleccionado de todas las listas
// para comprobar en que lista esta enfocada
m_list1.GetCurSel(&ItemCtrl1);
m_list2.GetCurSel(&ItemCtrl2);
m_list3.GetCurSel(&ItemCtrl3);
// Si se pulsa sobre la lista de dispositivos
if ( ItemCtrl1 == ItemCtrl1.GetFocus(XUSER_INDEX_ANY))
{
// Si se pulsa el boton B
if ( pInputData->dwKeyCode == VK_PAD_B )
{
//Se ocualta la lista de dispositivos
m_list1.SetOpacity(0);
//Enfoca la lista de archivos
m_list2.SetFocus(XUSER_INDEX_ANY);
bHandled = TRUE;
}
}
// Si se pulsa sobre la lista de ficheros
else if ( ItemCtrl2 == ItemCtrl2.GetFocus(XUSER_INDEX_ANY))
{
// Si se pulsa el boton B
if ( pInputData->dwKeyCode == VK_PAD_B )
{
//Se obtiene la posicion de la ultima barra del directorio actual
size_t pos = sDirAct.find_last_of("\\");
if (pos!=string::npos)
{
//Se extrae el subdirectorio
sDirAct = sDirAct.substr(0,pos);
//Se abre el subdirectorio
OpenDevice(sDirAct);
}
bHandled = TRUE;
}
// Si se pulsa el boton BACK
else if ( pInputData->dwKeyCode == VK_PAD_BACK )
{
//Se muestra la lista de dispositivos
m_list1.SetOpacity(1);
//Se enfoca la lista de dispositivos
m_list1.SetFocus(XUSER_INDEX_ANY);
bHandled = TRUE;
}
// Si se pulsa el boton X
else if ( pInputData->dwKeyCode == VK_PAD_X )
{
// Si el boton seleccionado esta marcado
if ( TRUE == m_list2.GetItemCheck(m_list2.GetCurSel()))
{
// Se quita la marca y se habilita
m_list2.SetItemCheck(m_list2.GetCurSel(), FALSE);
m_list2.SetItemEnable(m_list2.GetCurSel(), TRUE);
}
// Si el boton seleccionado no esta marcado
else
{
// Se marca y se deshabilita
m_list2.SetItemCheck(m_list2.GetCurSel(), TRUE);
m_list2.SetItemEnable(m_list2.GetCurSel(), FALSE);
}
bHandled = TRUE;
}
// Si se pulsa el boton Y
else if ( pInputData->dwKeyCode == VK_PAD_Y )
{
// Se muestra la lista de opciones
m_list3.SetOpacity(1);
// Se enfoca la lista de opciones
m_list3.SetFocus(XUSER_INDEX_ANY);
bHandled = TRUE;
}
// Si se pulsa arriba en el pad
else if ( pInputData->dwKeyCode == VK_PAD_DPAD_UP )
{
XuiScrollBarSetItemData( m_scrollBar1, m_list2.GetItemCount(), m_list2.GetCurSel(), 7 );
}
// Si se pulsa abajo en el pad
else if ( pInputData->dwKeyCode == VK_PAD_DPAD_DOWN )
{
XuiScrollBarSetItemData( m_scrollBar1, m_list2.GetItemCount(), m_list2.GetCurSel(), 7 );
}
// Si se pulsa sobre la lista de opciones de ficheros
}
else if( ItemCtrl3 == ItemCtrl2.GetFocus(XUSER_INDEX_ANY))
{
// Si se pulsa el boton B
if ( pInputData->dwKeyCode == VK_PAD_B )
{
//Se ocualta la lista de dispositivos
m_list3.SetOpacity(0);
//Enfoca la lista de archivos
m_list2.SetFocus(XUSER_INDEX_ANY);
bHandled = TRUE;
}
}
return S_OK;
}
//----------------------------------------------------------------------------------
// Abre un dispositivo y rellena la lista con los nombres.
//----------------------------------------------------------------------------------
HRESULT OpenDevice(string strFind)
{
HANDLE hFind; //Manejador de ficheros
WIN32_FIND_DATA wfd; //Informacion de los ficheros
LPSTR lpPath = new char[MAX_PATH]; //Directorio
LPWSTR lpPathW = new wchar_t[MAX_PATH]; //Directorio en caracteres anchos
LPSTR lpFileName = new char[MAX_PATH]; //Nombre del fichero
LPWSTR lpFileNameW = new wchar_t[MAX_PATH]; //Nombre del fichero en caracteres anchos
string sFileName;
// Elimino todos los Items de la lista
m_list2.DeleteItems(0, m_list2.GetItemCount());
//Guarda el directorio actual
sDirAct = strFind;
//Enfoca la lista de archivos
m_list2.SetFocus(XUSER_INDEX_ANY);
//Añado \* al directorio para buscar todos los archivos
strFind+= "\\*";
//Copia el directorio al puntero directorio
strFind._Copy_s(lpPath, strFind.length(),strFind.length());
//Añade el final del fichero
lpPath[strFind.length()]='\0';
//Convierte el directorio a caracteres anchos directorioW
::MultiByteToWideChar( CP_ACP, NULL,lpPath, -1, lpPathW, MAX_PATH);
// Muestro el nombre del directorio explorado
m_text1.SetText(lpPathW);
// Empieza la busqueda de ficheros
hFind = FindFirstFile( lpPath, &wfd );
if( INVALID_HANDLE_VALUE == hFind )
{
//Si falla la busqueda
}
else
{
int nIndex = 0;
// Se trata el fichero y se obtiene el siguiente
do
{
// Inserto un Item en la lista y le paso el nombre del fichero convirtiendolo en caracteres anchos
m_list2.InsertItems(nIndex,1);
sFileName = wfd.cFileName;
//Copia el fichero al puntero
sFileName._Copy_s(lpFileName, sFileName.length(), sFileName.length());
//Añade el final del fichero
lpFileName[sFileName.length()]='\0';
::MultiByteToWideChar( CP_ACP, NULL,lpFileName, -1, lpFileNameW, MAX_PATH);
m_list2.SetText(nIndex,lpFileNameW);
//Segun el tipo de fichero se asigna un icono
if(FILE_ATTRIBUTE_DIRECTORY == wfd.dwFileAttributes)
{
m_list2.SetImage(nIndex,L"file://game:/media/icons/folder.png");
}
else if ((sFileName.find(".xex"))!=string::npos)
{
m_list2.SetImage(nIndex,L"file://game:/media/icons/xex.png");
}
else
m_list2.SetImage(nIndex,L"file://game:/media/icons/file.png");
if (sFileName.find("nxeart")!=string::npos)
{
// CargarFondo2();
}
nIndex++;
} while( FindNextFile( hFind, &wfd ));
// Cierra el manejador de la busqueda
FindClose( hFind );
}
return S_OK;
}
//----------------------------------------------------------------------------------
// Selecciona los directorios y ficheros seleccionados
//----------------------------------------------------------------------------------
VOID SelectCheckedFiles()
{
LPSTR lpFileName = new char[MAX_PATH]; //Nombre del fichero
int nCount = 0;
for (int i=0; i {
if (m_list2.GetItemCheck(i))
{
//Convierte el nombre del fichero a caracteres
::WideCharToMultiByte(CP_ACP,NULL,m_list2.GetText(i),-1,lpFileName,MAX_PATH,NULL,NULL);
//Añade el nombre del fichero al directorio Actual
sSelectedFiles[nCount]= sDirAct;
sSelectedFiles[nCount]+= "\\";
sSelectedFiles[nCount]+= lpFileName;
nCount++;
}
}
sSelectedFiles[nCount].clear();
}
//----------------------------------------------------------------------------------
// Copya los ficheros y directorios del directorio pasado al sDirAct
//----------------------------------------------------------------------------------
VOID CopyDirectory(string sDestino, string sOrigen)
{
HANDLE hFind; //Manejador de ficheros
WIN32_FIND_DATA wfd; //Informacion de los ficheros
LPSTR lpOrigen = new char[MAX_PATH]; //Directorio
LPSTR lpDestino = new char[MAX_PATH];
string sPathOrig;
string sPathDest;
sPathOrig = sOrigen;
//Añado \* al directorio para buscar todos los archivos
sPathOrig+= "\\*";
//Copia el directorio al puntero directorio
sPathOrig._Copy_s(lpOrigen, sPathOrig.length(), sPathOrig.length());
//Añade el final del fichero
lpOrigen[sPathOrig.length()]='\0';
// Empieza la busqueda de ficheros
hFind = FindFirstFile( lpOrigen, &wfd );
if( INVALID_HANDLE_VALUE == hFind )
{
//Si falla la busqueda
}
else
{
// Se trata el fichero y se obtiene el siguiente
do
{
sPathOrig = sOrigen;
sPathOrig+="\\";
sPathOrig+= wfd.cFileName;
sPathOrig._Copy_s(lpOrigen, sPathOrig.length(), sPathOrig.length());
lpOrigen[sPathOrig.length()]='\0';
sPathDest = sDestino;
sPathDest+= "\\";
sPathDest+= wfd.cFileName;
sPathDest._Copy_s(lpDestino, sPathDest.length(), sPathDest.length());
lpDestino[sPathDest.length()]='\0';
//Si el fichero a copia es un directorio
if (wfd.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
{
//Se crea el directorio
CreateDirectory(
lpDestino, // directory name
NULL // SD
);
CopyDirectory(sPathDest, sPathOrig);
if (iManagerOption == CUT)
RemoveDirectory(lpOrigen);
}
else
{
if (iManagerOption == COPY)
{
CopyFileEx(
lpOrigen, // name of existing file
lpDestino, // name of new file
NULL,//CopyProgressRoutine, // callback function
NULL, // callback parameter
NULL, // cancel status
NULL
// COPY_FILE_FAIL_IF_EXISTS // copy iManagerOptions
);
}
else if (iManagerOption == CUT)
{
MoveFileWithProgress(
lpOrigen, // name of existing file
lpDestino, // name of new file
NULL, //CopyProgressRoutine, // callback function
NULL, // callback parameter
MOVEFILE_REPLACE_EXISTING
// COPY_FILE_FAIL_IF_EXISTS // copy iManagerOptions
);
}
}
} while( FindNextFile( hFind, &wfd ));
// Cierra el manejador de la busqueda
FindClose( hFind );
}
}
//----------------------------------------------------------------------------------
// Elimina los ficheros y directorios del directorio pasado
//----------------------------------------------------------------------------------
VOID DeleteDirectory(string sPath)
{
HANDLE hFind; //Manejador de ficheros
WIN32_FIND_DATA wfd; //Informacion de los ficheros
LPSTR lpPath = new char[MAX_PATH]; //Directorio
string sDirPath;
sDirPath = sPath;
//Añado \* al directorio para buscar todos los archivos
sDirPath+= "\\*";
//Copia el directorio al puntero directorio
sDirPath._Copy_s(lpPath, sDirPath.length(), sDirPath.length());
//Añade el final del fichero
lpPath[sDirPath.length()]='\0';
// Empieza la busqueda de ficheros
hFind = FindFirstFile( lpPath, &wfd );
if( INVALID_HANDLE_VALUE == hFind )
{
//Si falla la busqueda
}
else
{
// Se trata el fichero y se obtiene el siguiente
do
{
sDirPath = sPath;
sDirPath+= "\\";
sDirPath+= wfd.cFileName;
sDirPath._Copy_s(lpPath, sDirPath.length(), sDirPath.length());
lpPath[sDirPath.length()] = '\0';
//Si el fichero a copia es un directorio
if(FILE_ATTRIBUTE_DIRECTORY == wfd.dwFileAttributes)
{
DeleteDirectory(sDirPath);
//Se crea el directorio
RemoveDirectory(
lpPath // directory name
);
}
else
{
DeleteFile(
lpPath // file name
);
}
} while( FindNextFile( hFind, &wfd ));
// Cierra el manejador de la busqueda
FindClose( hFind );
}
}
//----------------------------------------------------------------------------------
// Indica el progreso en la copia de ficheros
//----------------------------------------------------------------------------------
/* static DWORD CopyProgressRoutine(
LARGE_INTEGER TotalFileSize, // file size
LARGE_INTEGER TotalBytesTransferred, // bytes transferred
LARGE_INTEGER StreamSize, // bytes in stream
LARGE_INTEGER StreamBytesTransferred, // bytes transferred for stream
DWORD dwStreamNumber, // current stream
DWORD dwCallbackReason, // callback reason
HANDLE hSourceFile, // handle to source file
HANDLE hDestinationFile, // handle to destination file
LPVOID lpData )// from CopyFileEx
{
int nValue = (TotalFileSize.QuadPart / TotalBytesTransferred.QuadPart) * 100;
m_progressBar1.std.SetValue(nValue);
return 0;
}
*/ //----------------------------------------------------------------------------------
// Pega los ficheros
//----------------------------------------------------------------------------------
VOID PasteFiles()
{
LPSTR lpFileName = new char[MAX_PATH]; //Nombre del fichero
LPWSTR lpFileNameW = new wchar_t[MAX_PATH]; //Nombre del fichero caracteres anchos
string sFileName;
LPSTR lpOrigen = new char[MAX_PATH];
LPSTR lpDestino = new char[MAX_PATH];
string sDestino;
m_text2.SetOpacity(1);
m_button1.SetOpacity(1);
m_progressBar1.SetOpacity(1);
int i = 0;
if (sSelectedFiles != "\0")
{
do{
//Inicializa la barra de progreso
// m_progressBar1.SetRange(0,100);
// m_progressBar1.SetValue(0);
//Copia el nombre del directorio actual
sDestino = sDirAct;
//Se obtiene la posicion de la ultima barra del directorio actual
size_t pos = sSelectedFiles.find_last_of("\\");
//Extrae el nombre del fichero con la barra
sFileName = sSelectedFiles.substr(pos+1);
//Copiar el nombre del fichero a un puntero
sFileName._Copy_s(lpFileName, sFileName.length(),sFileName.length());
//Añade el final del fichero
lpFileName[sFileName.length()]='\0';
//Convierte el nombre del fichero a caracteres anchos
::MultiByteToWideChar( CP_ACP, NULL, lpFileName, -1, lpFileNameW, MAX_PATH);
//Se muestra el nombre en el boton de la barra de progreso
m_text2.SetText(lpFileNameW);
//Añade el nombre del fichero al directorio destino
sDestino+="\\";
sDestino+=sFileName;
sSelectedFiles._Copy_s(lpOrigen, sSelectedFiles.length(), sSelectedFiles.length());
lpOrigen[sSelectedFiles.length()]='\0';
//Copia el directorio al puntero directorio
sDestino._Copy_s(lpDestino, sDestino.length(), sDestino.length());
lpDestino[sDestino.length()]='\0';
//Si el fichero a copia es un directorio
if(FILE_ATTRIBUTE_DIRECTORY == GetFileAttributes(lpOrigen))
{
//Se crea el directorio
CreateDirectory(
lpDestino, // directory name
NULL // SD
);
CopyDirectory(sDestino, sSelectedFiles);
if (iManagerOption == CUT)
RemoveDirectory(lpOrigen);
}
else
{
if (iManagerOption == COPY)
{
CopyFileEx(
lpOrigen, // name of existing file
lpDestino, // name of new file
NULL,//CopyProgressRoutine, // callback function
NULL, // callback parameter
NULL, // cancel status
NULL
// COPY_FILE_FAIL_IF_EXISTS // copy iManagerOptions
);
}
else if (iManagerOption == CUT)
{
MoveFileWithProgress(
lpOrigen, // name of existing file
lpDestino, // name of new file
NULL, //CopyProgressRoutine, // callback function
NULL, // callback parameter
MOVEFILE_REPLACE_EXISTING
// COPY_FILE_FAIL_IF_EXISTS // copy iManagerOptions
);
}
}
i++;
}while (sSelectedFiles != "\0");
OpenDevice(sDirAct);
}
m_button1.SetOpacity(0);
m_text2.SetOpacity(0);
m_progressBar1.SetOpacity(0);
}
//----------------------------------------------------------------------------------
// Borra los ficheros
//----------------------------------------------------------------------------------
VOID DeleteFiles()
{
LPSTR lpFileName = new char[MAX_PATH]; //Nombre del fichero
LPWSTR lpFileNameW = new wchar_t[MAX_PATH]; //Nombre del fichero caracteres anchos
string sFileName;
for (int i=0; i {
if (m_list2.GetItemCheck(i))