Accueil > > > PACKAGE MANAGER
PACKAGE MANAGER
Information sur la source
Description
Ce code a été mis au point par Heliopraetor pour le compte de NaHelWorks (je poste le code sur sa demande). Il nous sert d'archiveur. L'avantage de ce code est qu'il est "maison". Il n'y a aucune compression, et ce n'est pas le but. Le but recherché est juste de regrouper plusieurs fichiers dans un seul. Ce qui est fait à la perfection par mon ami. Il utilise la classe CResourceManager, faite maison aussi (et complétement retravaillée depuis WaterBall). Cette source est utile pour maîtriser la programmation windows win32 par l'api, avec la gestion des listbox, et également l'accès binaire à des fichiers par les opérateurs classiques...
Source
- //main.cpp
- /*
-
- Package Manager 1.0 Par NaHelWorks (Heliopraetor)
-
- Ouvre les fichiers package TPP, format d'archive spécialement développé pour
- les besoins de l'équipe.
-
- www.nahelworks.free.fr
-
- */
-
- #include <windows.h>
- #include <assert.h>
- #include <sys/stat.h>
- #include <stdio.h>
- #include <shlobj.h>
-
- #include "resource.h"
- #include "CResourceManager.h"
-
- bool FileExist(const char* _File)
- {
- struct stat Info;
- return !stat(_File, &Info );
- }
-
-
-
- /********************************************************************************
- * *
- * *
- * Variables globales. *
- * *
- * *
- ********************************************************************************/
-
-
- HWND g_hDlg;
- HINSTANCE g_hInstance;
-
- CResourceManager g_RM;
-
- char g_PackageName[MAX_PATH];
- HWND g_hList;
-
-
- /********************************************************************************
- * *
- * *
- * Fonction d'actualisation de l'application. *
- * *
- * *
- ********************************************************************************/
- void PgmUpdate()
- {
- //List
- g_RM._UpdateWndList(g_hList,g_PackageName);
-
- //Nombre de fichiers
- char l_sFile[256];
- sprintf(l_sFile,"%d",SendMessage(g_hList,LB_GETCOUNT,NULL,NULL));
- SetWindowText(GetDlgItem(g_hDlg,IDC_NBEDIT),l_sFile);
-
- //Taille du package
- float size=g_RM._Size(g_PackageName);
- sprintf(l_sFile,"%.2f ko",size/1024.0f);
- SetWindowText(GetDlgItem(g_hDlg,IDC_SIZEEDIT),l_sFile);
- }
-
-
-
- /********************************************************************************
- * *
- * *
- * Fonction de fermeture du package. *
- * *
- * *
- ********************************************************************************/
- void ClosePackage()
- {
- g_PackageName[0]='\0';
- g_RM._EmptyList(g_hList);
-
- SetWindowText(g_hDlg,"Package Manager");
- SetWindowText(GetDlgItem(g_hDlg,IDC_NBEDIT),NULL);
- SetWindowText(GetDlgItem(g_hDlg,IDC_SIZEEDIT),NULL);
- }
-
-
- /********************************************************************************
- * *
- * *
- * Fonction de chargement d'un package par boîte windows. *
- * *
- * *
- ********************************************************************************/
- void OpenPackage()
- {
- OPENFILENAME ofn;
- char l_sFile[MAX_PATH];
-
- ZeroMemory(l_sFile,MAX_PATH);
- ZeroMemory(&ofn, sizeof(ofn));
-
- ofn.lStructSize = sizeof(ofn);
- ofn.hwndOwner = g_hDlg;
- ofn.lpstrFilter = "Fichiers TPP (*.tpp)\0*.tpp\0\0";
- ofn.lpstrFile = l_sFile;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrDefExt = "tpp";
- ofn.Flags = OFN_EXPLORER|OFN_PATHMUSTEXIST;
- ofn.lpstrTitle = "Sélection d'un fichier package";
-
- if(!GetOpenFileName(&ofn))
- return;
- if( l_sFile == NULL )
- return;
-
- strcpy(g_PackageName,l_sFile);
- sprintf(l_sFile,"Package Manager - %s",g_PackageName);
-
- SetWindowText(g_hDlg,l_sFile);
-
- PgmUpdate();
- }
-
-
- /********************************************************************************
- * *
- * *
- * Fonction de création d'un package par boîte windows. *
- * *
- * *
- ********************************************************************************/
- void CreatePackage()
- {
- OPENFILENAME ofn;
- char l_sFile[MAX_PATH];
-
- ZeroMemory(l_sFile,MAX_PATH);
- ZeroMemory(&ofn, sizeof(ofn));
-
- ofn.lStructSize = sizeof(ofn);
- ofn.hwndOwner = g_hDlg;
- ofn.lpstrFilter = "Fichier TPP (*.tpp)\0*.tpp\0\0";
- ofn.lpstrFile = l_sFile;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrDefExt = "tpp";
- ofn.Flags = OFN_EXPLORER|OFN_PATHMUSTEXIST;
- ofn.lpstrTitle = "Création d'un fichier package";
-
- if(!GetSaveFileName(&ofn))
- return;
- if( l_sFile == NULL )
- return;
-
- strcpy(g_PackageName,l_sFile);
- sprintf(l_sFile,"Package Manager - %s",g_PackageName);
-
- SetWindowText(g_hDlg,l_sFile);
-
- g_RM._OpenPackage(g_PackageName,true);
-
- PgmUpdate();
- }
-
-
-
- /********************************************************************************
- * *
- * *
- * Fonction d'ajout d'un fichier par boîte windows. *
- * *
- * *
- ********************************************************************************/
- void AddFiles()
- {
- //Création d'une boîte d'ouverture de fichiers
- OPENFILENAME ofn;
- char l_sFile[MAX_PATH];
- ZeroMemory(l_sFile,MAX_PATH);
- ZeroMemory(&ofn, sizeof(ofn));
-
- ofn.lStructSize = sizeof(ofn);
- ofn.hwndOwner = g_hDlg;
- ofn.lpstrFilter = "Tout fichier (*.*)\0*.*\0\0";
- ofn.lpstrFile = l_sFile;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrDefExt = "";
- ofn.Flags = OFN_EXPLORER|OFN_PATHMUSTEXIST|OFN_ALLOWMULTISELECT;
- ofn.lpstrTitle = "Sélection de fichiers à ajouter au package";
-
- //Ouverture de la boîte
- if(!GetOpenFileName(&ofn))
- return;
- if( l_sFile == NULL )
- return;
-
- //Traitement selon le(s) fichier(s) sélectionné(s)
- char dir[MAX_PATH];
- if ( ofn.nFileOffset < strlen(l_sFile) ) //si un seul
- {
- char* pos=NULL;
- for (int offset=0 ; *(l_sFile+offset)!='\0' ; offset++)
- {
- if (*(l_sFile+offset)=='\\')
- pos=(l_sFile+offset+1);
- }
- g_RM._AddFileToPackage(g_PackageName,l_sFile,pos);
- }
- else //si plusieurs
- {
- sprintf(dir,"%s\\",l_sFile);
- char cpltfile[MAX_PATH];
- while ( l_sFile[ofn.nFileOffset] != '\0' )
- {
- sprintf(cpltfile,"%s%s",dir,l_sFile+ofn.nFileOffset);
- g_RM._AddFileToPackage(g_PackageName,cpltfile,l_sFile+ofn.nFileOffset);
- ofn.nFileOffset += (strlen(l_sFile+ofn.nFileOffset) + 1);
- }
- }
- PgmUpdate();
- }
-
-
- /********************************************************************************
- * *
- * *
- * Fonction de suppression de fichiers dans l'archive. *
- * *
- * *
- ********************************************************************************/
- void DeleteFiles()
- {
- //Obtention du nombre de fichiers sélectionnés
- int nb = SendMessage(g_hList,LB_GETSELCOUNT,NULL,NULL);
- if (!nb) return;
-
- //Récupération des indexs de fichiers récupérés
- int* buffer = new int[nb];
- SendMessage(g_hList,LB_GETSELITEMS,nb,(LPARAM)buffer);
-
- //Suppression des fichiers sélectionnés
- for (int i=nb-1 ; i>-1 ; i--)
- {
- SendMessage(g_hList,LB_DELETESTRING,buffer[i],NULL);
- g_RM._DeleteFile(buffer[i],g_PackageName);
- }
-
- //Actualisation et fin
- PgmUpdate();
- delete [] buffer;
- }
-
- /********************************************************************************
- * *
- * *
- * Fonction d'extraction de fichiers de l'archive. *
- * *
- * *
- ********************************************************************************/
- void ExtractFiles(bool all)
- {
- char Dir[MAX_PATH];
- ZeroMemory(Dir,MAX_PATH);
- BROWSEINFO bi;
- ZeroMemory(&bi, sizeof(bi));
-
- bi.hwndOwner = g_hDlg;
- bi.pidlRoot = NULL;
- bi.pszDisplayName = Dir;
- bi.lpszTitle = "Sélection du dossier où extraire (remplacement automatique)";
- bi.ulFlags = BIF_DONTGOBELOWDOMAIN|BIF_RETURNONLYFSDIRS;
- bi.lpfn = NULL;
- bi.lParam = NULL;
- int iImage = NULL;
-
- LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
- if (!pidl)
- return;
- if (Dir[0]=='\0')
- return;
-
- SHGetPathFromIDList(pidl,Dir);
-
- if (all)
- {
- g_RM._ExtractPackage(g_PackageName,Dir);
- }
- else
- {
- //Obtention du nombre de fichiers sélectionnés
- int nb = SendMessage(g_hList,LB_GETSELCOUNT,NULL,NULL);
- if (!nb) return;
-
- //Récupération des indexs de fichiers récupérés
- int* buffer = new int[nb];
- SendMessage(g_hList,LB_GETSELITEMS,nb,(LPARAM)buffer);
-
- //Extraction des fichiers sélectionnés
- for (int i=nb-1 ; i>-1 ; i--)
- {
- g_RM._ExtractFile(buffer[i],g_PackageName,Dir);
- }
- delete [] buffer;
- }
- }
-
-
-
-
- /********************************************************************************
- * *
- * *
- * Fonction de centrage d'une fenêtre et de sa mise au premier-plan. *
- * *
- * *
- ********************************************************************************/
- bool CenterDlg(HWND hWnd)
- {
- RECT l_Dim;
- GetWindowRect(hWnd,&l_Dim);
-
- //Center the window
- SetWindowPos(hWnd,HWND_TOPMOST,(GetSystemMetrics(SM_CXSCREEN)-(l_Dim.right - l_Dim.left))/2,
- (GetSystemMetrics(SM_CYSCREEN)-(l_Dim.bottom - l_Dim.top))/2,
- l_Dim.right - l_Dim.left,
- l_Dim.bottom - l_Dim.top,
- SWP_SHOWWINDOW);
- //Center the window
- SetWindowPos(hWnd,HWND_NOTOPMOST,(GetSystemMetrics(SM_CXSCREEN)-(l_Dim.right - l_Dim.left))/2,
- (GetSystemMetrics(SM_CYSCREEN)-(l_Dim.bottom - l_Dim.top))/2,
- l_Dim.right - l_Dim.left,
- l_Dim.bottom - l_Dim.top,
- SWP_SHOWWINDOW);
-
- return true;
- }
-
-
-
-
-
- /********************************************************************************
- * *
- * *
- * Fonction de traitement des messages de la fenêtre principale. *
- * *
- * *
- ********************************************************************************/
- LRESULT CALLBACK DlgProc(HWND DlgProc, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- switch(msg)
- {
- case WM_CLOSE:
- case WM_QUIT:
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
- case WM_INITDIALOG:
- {
- ShowWindow(g_hDlg, SW_SHOW);
- SetForegroundWindow(g_hDlg);
- CenterDlg(DlgProc);
- break;
- }
- case WM_COMMAND:
- {
- switch( HIWORD(wParam) )
- {
- case BN_CLICKED:
- {
- bool extractall=false;
- switch( LOWORD(wParam) )
- {
- case IDCLOSE:
- PostQuitMessage(0);
- break;
- case ID_OPENARCH:
- OpenPackage();
- break;
- case ID_CLOSEARCH:
- if (*g_PackageName)
- ClosePackage();
- break;
- case ID_CREATEARCH:
- if (*g_PackageName)
- ClosePackage();
- OpenPackage();
- break;
- case ID_ADD:
- if (*g_PackageName)
- AddFiles();
- break;
- case ID_DELETE:
- if (*g_PackageName)
- DeleteFiles();
- break;
- case ID_EXTRACTARCH:
- extractall=true;
- case ID_EXTRACT:
- if (*g_PackageName)
- ExtractFiles(extractall);
- break;
- }
- }
- }
- }
- }
- return false;
- }
-
-
- /********************************************************************************
- * *
- * *
- * Fonction WinMain. *
- * *
- * *
- ********************************************************************************/
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
- {
- //Lancement du SplashScreen
- g_hInstance=hInstance;
-
- //Création de la fenêtre
- g_hDlg = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_MAIN), HWND_TOP, (DLGPROC) DlgProc);
- if(g_hDlg == NULL)
- {
- MessageBox(NULL, "Création de la fenêtre échouée.", "Erreur", MB_ICONEXCLAMATION|MB_OK);
- return 0;
- }
-
- g_hList=GetDlgItem(g_hDlg,IDC_LIST);
-
- //Boucle de message
- MSG Msg;
- while( GetMessage(&Msg,NULL,0,0) > 0 )
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
- }
-
- //Fin du programme
- DestroyWindow(g_hDlg);
- return Msg.wParam;
- }
//main.cpp
/*
Package Manager 1.0 Par NaHelWorks (Heliopraetor)
Ouvre les fichiers package TPP, format d'archive spécialement développé pour
les besoins de l'équipe.
www.nahelworks.free.fr
*/
#include <windows.h>
#include <assert.h>
#include <sys/stat.h>
#include <stdio.h>
#include <shlobj.h>
#include "resource.h"
#include "CResourceManager.h"
bool FileExist(const char* _File)
{
struct stat Info;
return !stat(_File, &Info );
}
/********************************************************************************
* *
* *
* Variables globales. *
* *
* *
********************************************************************************/
HWND g_hDlg;
HINSTANCE g_hInstance;
CResourceManager g_RM;
char g_PackageName[MAX_PATH];
HWND g_hList;
/********************************************************************************
* *
* *
* Fonction d'actualisation de l'application. *
* *
* *
********************************************************************************/
void PgmUpdate()
{
//List
g_RM._UpdateWndList(g_hList,g_PackageName);
//Nombre de fichiers
char l_sFile[256];
sprintf(l_sFile,"%d",SendMessage(g_hList,LB_GETCOUNT,NULL,NULL));
SetWindowText(GetDlgItem(g_hDlg,IDC_NBEDIT),l_sFile);
//Taille du package
float size=g_RM._Size(g_PackageName);
sprintf(l_sFile,"%.2f ko",size/1024.0f);
SetWindowText(GetDlgItem(g_hDlg,IDC_SIZEEDIT),l_sFile);
}
/********************************************************************************
* *
* *
* Fonction de fermeture du package. *
* *
* *
********************************************************************************/
void ClosePackage()
{
g_PackageName[0]='\0';
g_RM._EmptyList(g_hList);
SetWindowText(g_hDlg,"Package Manager");
SetWindowText(GetDlgItem(g_hDlg,IDC_NBEDIT),NULL);
SetWindowText(GetDlgItem(g_hDlg,IDC_SIZEEDIT),NULL);
}
/********************************************************************************
* *
* *
* Fonction de chargement d'un package par boîte windows. *
* *
* *
********************************************************************************/
void OpenPackage()
{
OPENFILENAME ofn;
char l_sFile[MAX_PATH];
ZeroMemory(l_sFile,MAX_PATH);
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = g_hDlg;
ofn.lpstrFilter = "Fichiers TPP (*.tpp)\0*.tpp\0\0";
ofn.lpstrFile = l_sFile;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "tpp";
ofn.Flags = OFN_EXPLORER|OFN_PATHMUSTEXIST;
ofn.lpstrTitle = "Sélection d'un fichier package";
if(!GetOpenFileName(&ofn))
return;
if( l_sFile == NULL )
return;
strcpy(g_PackageName,l_sFile);
sprintf(l_sFile,"Package Manager - %s",g_PackageName);
SetWindowText(g_hDlg,l_sFile);
PgmUpdate();
}
/********************************************************************************
* *
* *
* Fonction de création d'un package par boîte windows. *
* *
* *
********************************************************************************/
void CreatePackage()
{
OPENFILENAME ofn;
char l_sFile[MAX_PATH];
ZeroMemory(l_sFile,MAX_PATH);
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = g_hDlg;
ofn.lpstrFilter = "Fichier TPP (*.tpp)\0*.tpp\0\0";
ofn.lpstrFile = l_sFile;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "tpp";
ofn.Flags = OFN_EXPLORER|OFN_PATHMUSTEXIST;
ofn.lpstrTitle = "Création d'un fichier package";
if(!GetSaveFileName(&ofn))
return;
if( l_sFile == NULL )
return;
strcpy(g_PackageName,l_sFile);
sprintf(l_sFile,"Package Manager - %s",g_PackageName);
SetWindowText(g_hDlg,l_sFile);
g_RM._OpenPackage(g_PackageName,true);
PgmUpdate();
}
/********************************************************************************
* *
* *
* Fonction d'ajout d'un fichier par boîte windows. *
* *
* *
********************************************************************************/
void AddFiles()
{
//Création d'une boîte d'ouverture de fichiers
OPENFILENAME ofn;
char l_sFile[MAX_PATH];
ZeroMemory(l_sFile,MAX_PATH);
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = g_hDlg;
ofn.lpstrFilter = "Tout fichier (*.*)\0*.*\0\0";
ofn.lpstrFile = l_sFile;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "";
ofn.Flags = OFN_EXPLORER|OFN_PATHMUSTEXIST|OFN_ALLOWMULTISELECT;
ofn.lpstrTitle = "Sélection de fichiers à ajouter au package";
//Ouverture de la boîte
if(!GetOpenFileName(&ofn))
return;
if( l_sFile == NULL )
return;
//Traitement selon le(s) fichier(s) sélectionné(s)
char dir[MAX_PATH];
if ( ofn.nFileOffset < strlen(l_sFile) ) //si un seul
{
char* pos=NULL;
for (int offset=0 ; *(l_sFile+offset)!='\0' ; offset++)
{
if (*(l_sFile+offset)=='\\')
pos=(l_sFile+offset+1);
}
g_RM._AddFileToPackage(g_PackageName,l_sFile,pos);
}
else //si plusieurs
{
sprintf(dir,"%s\\",l_sFile);
char cpltfile[MAX_PATH];
while ( l_sFile[ofn.nFileOffset] != '\0' )
{
sprintf(cpltfile,"%s%s",dir,l_sFile+ofn.nFileOffset);
g_RM._AddFileToPackage(g_PackageName,cpltfile,l_sFile+ofn.nFileOffset);
ofn.nFileOffset += (strlen(l_sFile+ofn.nFileOffset) + 1);
}
}
PgmUpdate();
}
/********************************************************************************
* *
* *
* Fonction de suppression de fichiers dans l'archive. *
* *
* *
********************************************************************************/
void DeleteFiles()
{
//Obtention du nombre de fichiers sélectionnés
int nb = SendMessage(g_hList,LB_GETSELCOUNT,NULL,NULL);
if (!nb) return;
//Récupération des indexs de fichiers récupérés
int* buffer = new int[nb];
SendMessage(g_hList,LB_GETSELITEMS,nb,(LPARAM)buffer);
//Suppression des fichiers sélectionnés
for (int i=nb-1 ; i>-1 ; i--)
{
SendMessage(g_hList,LB_DELETESTRING,buffer[i],NULL);
g_RM._DeleteFile(buffer[i],g_PackageName);
}
//Actualisation et fin
PgmUpdate();
delete [] buffer;
}
/********************************************************************************
* *
* *
* Fonction d'extraction de fichiers de l'archive. *
* *
* *
********************************************************************************/
void ExtractFiles(bool all)
{
char Dir[MAX_PATH];
ZeroMemory(Dir,MAX_PATH);
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(bi));
bi.hwndOwner = g_hDlg;
bi.pidlRoot = NULL;
bi.pszDisplayName = Dir;
bi.lpszTitle = "Sélection du dossier où extraire (remplacement automatique)";
bi.ulFlags = BIF_DONTGOBELOWDOMAIN|BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
bi.lParam = NULL;
int iImage = NULL;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
if (!pidl)
return;
if (Dir[0]=='\0')
return;
SHGetPathFromIDList(pidl,Dir);
if (all)
{
g_RM._ExtractPackage(g_PackageName,Dir);
}
else
{
//Obtention du nombre de fichiers sélectionnés
int nb = SendMessage(g_hList,LB_GETSELCOUNT,NULL,NULL);
if (!nb) return;
//Récupération des indexs de fichiers récupérés
int* buffer = new int[nb];
SendMessage(g_hList,LB_GETSELITEMS,nb,(LPARAM)buffer);
//Extraction des fichiers sélectionnés
for (int i=nb-1 ; i>-1 ; i--)
{
g_RM._ExtractFile(buffer[i],g_PackageName,Dir);
}
delete [] buffer;
}
}
/********************************************************************************
* *
* *
* Fonction de centrage d'une fenêtre et de sa mise au premier-plan. *
* *
* *
********************************************************************************/
bool CenterDlg(HWND hWnd)
{
RECT l_Dim;
GetWindowRect(hWnd,&l_Dim);
//Center the window
SetWindowPos(hWnd,HWND_TOPMOST,(GetSystemMetrics(SM_CXSCREEN)-(l_Dim.right - l_Dim.left))/2,
(GetSystemMetrics(SM_CYSCREEN)-(l_Dim.bottom - l_Dim.top))/2,
l_Dim.right - l_Dim.left,
l_Dim.bottom - l_Dim.top,
SWP_SHOWWINDOW);
//Center the window
SetWindowPos(hWnd,HWND_NOTOPMOST,(GetSystemMetrics(SM_CXSCREEN)-(l_Dim.right - l_Dim.left))/2,
(GetSystemMetrics(SM_CYSCREEN)-(l_Dim.bottom - l_Dim.top))/2,
l_Dim.right - l_Dim.left,
l_Dim.bottom - l_Dim.top,
SWP_SHOWWINDOW);
return true;
}
/********************************************************************************
* *
* *
* Fonction de traitement des messages de la fenêtre principale. *
* *
* *
********************************************************************************/
LRESULT CALLBACK DlgProc(HWND DlgProc, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CLOSE:
case WM_QUIT:
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_INITDIALOG:
{
ShowWindow(g_hDlg, SW_SHOW);
SetForegroundWindow(g_hDlg);
CenterDlg(DlgProc);
break;
}
case WM_COMMAND:
{
switch( HIWORD(wParam) )
{
case BN_CLICKED:
{
bool extractall=false;
switch( LOWORD(wParam) )
{
case IDCLOSE:
PostQuitMessage(0);
break;
case ID_OPENARCH:
OpenPackage();
break;
case ID_CLOSEARCH:
if (*g_PackageName)
ClosePackage();
break;
case ID_CREATEARCH:
if (*g_PackageName)
ClosePackage();
OpenPackage();
break;
case ID_ADD:
if (*g_PackageName)
AddFiles();
break;
case ID_DELETE:
if (*g_PackageName)
DeleteFiles();
break;
case ID_EXTRACTARCH:
extractall=true;
case ID_EXTRACT:
if (*g_PackageName)
ExtractFiles(extractall);
break;
}
}
}
}
}
return false;
}
/********************************************************************************
* *
* *
* Fonction WinMain. *
* *
* *
********************************************************************************/
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
{
//Lancement du SplashScreen
g_hInstance=hInstance;
//Création de la fenêtre
g_hDlg = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_MAIN), HWND_TOP, (DLGPROC) DlgProc);
if(g_hDlg == NULL)
{
MessageBox(NULL, "Création de la fenêtre échouée.", "Erreur", MB_ICONEXCLAMATION|MB_OK);
return 0;
}
g_hList=GetDlgItem(g_hDlg,IDC_LIST);
//Boucle de message
MSG Msg;
while( GetMessage(&Msg,NULL,0,0) > 0 )
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
//Fin du programme
DestroyWindow(g_hDlg);
return Msg.wParam;
}
Conclusion
Ne figure ici que main.cpp : tout le reste est dans le zip.
Historique
- 15 mars 2005 21:12:04 :
- Descriptions plus complète.
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
[TECHDAYS2012] OUI J'Y SERAI![TECHDAYS2012] OUI J'Y SERAI! par JeremyJeanson
Bonsoir, Certes, je l'annonce avec un peu de retard, mais je serai effectivement au Techdays demain. Comme l'an dernier, je participerai au programme ATE (Ask The Expert). Si vous avez des questions Workflow, WCF, AppFabric ou plus généralement .net, n'hé...
Cliquez pour lire la suite de l'article par JeremyJeanson TFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICESTFS INTEGRATION TOOLS - SUIVI DES SYNCHRONISATIONS AVEC REPORTING SERVICES par vfabing
Afin de s'assurer du bon fonctionnement des différentes synchronisations effectuées par les TFS Integration Tools, 2 rapports sont présents dès l'installation. Il suffit alors d'effectuer les manipulations suivantes pour pouvoir les visualiser : Loca...
Cliquez pour lire la suite de l'article par vfabing CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT)CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT) par FREMYCOMPANY
Bonjour à tous, Je viens de publier une proposition comprenant 5 pseudo-classes pour le CSS Working Group ayant trait à l'état de chargement d'un élément (ex: IMG,VIDEO,AUDIO,OBJECT pour l'HTML.). Si le c½ur vous en dit, vous pouvez retrouver cette p...
Cliquez pour lire la suite de l'article par FREMYCOMPANY MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ?MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ? par ROMELARD Fabrice
Formation initiale Durant la formation, le découpage classique est le suivant (je donnerai les équivalences Suisse lorsque je les connaîtrais) : Ecole primaire jusqu'au Collège : Formation générale permettant d'obtenir les méthodes...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice Y'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENTY'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENT par Aleks
Quand on a ce genre d'erreur sans log :
Et bas on a juste envie de choper le gas de Microsoft qu'a développé ça et lui foutre des baffes de Coboye ! ...
Cliquez pour lire la suite de l'article par Aleks
Forum
RE : ARBRE BINAIRERE : ARBRE BINAIRE par pacotheking
Cliquez pour lire la suite par pacotheking
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|