IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Visual C++ Discussion :

Probleme de progressbar


Sujet :

Visual C++

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé Avatar de saidus
    Homme Profil pro
    Inscrit en
    Octobre 2004
    Messages
    166
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48

    Informations forums :
    Inscription : Octobre 2004
    Messages : 166
    Par défaut Probleme de progressbar
    Bonjour a tous !!
    je suis un newbie sur VC6 alors j'ai ce petit probleme ...
    j'ai creer une application Win32 vide et j'ai ajouter une DialogBox avec quelque controls (LABELs, COMBOBOX, IMAGE) et tout marche bien (Compilation + lancement ). Mais dès que j'ajoute un ProgressBar j'ai un probleme de lancement(l'appli se compile mais se lance pas).
    Please Help ME
    voici le code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
     
    //---------------------------------------------------------------------------
     
    #include <windows.h>
    #include "resource.h"
     
    //#pragma hdrstop
    //---------------------------------------------------------------------------
    //#pragma argsused
    //  Dialog PROC
    HINSTANCE hInst;
    static HICON hIcon;
    static HICON hIconSm;
     
     
    LRESULT CALLBACK MainProc(HWND Dlg, UINT message, WPARAM wParam, LPARAM lParam)
    {
     
        switch(message)
        {
            case WM_INITDIALOG:
    			{   /*
    				* TODO: Add code to initialize the dialog.
    				**/
    				hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 32, 32, 0);
    				SendMessage(Dlg, WM_SETICON, ICON_BIG  , (LPARAM)hIcon);
    				hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
    				SendMessage(Dlg, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
    				//break;
    				return TRUE;
    			}
     
            case WM_CLOSE:
    			{
    				DestroyIcon(hIcon);
    				DestroyIcon(hIconSm);           
    				EndDialog(Dlg, 0);
    				return TRUE;
    			}
     
            case WM_COMMAND:
                switch(LOWORD(wParam))
                {
                    /*
                     * TODO: Add more control ID's, when needed.
                     */
                    case IDCLOSE:
                        EndDialog(Dlg, 0);
                        return TRUE;
     
                    case IDC_GO:
                        MessageBox(Dlg, "You clicked \"Test\" button!", "Information", MB_ICONINFORMATION);
    					// Code for Decompression ...
                        return TRUE ;
    				case IDC_ABOUT:
    					MessageBox(Dlg, "UNZIP SFX build by bSaidus !!\nUnzip code from INFOZIP...\nContact -: bsaidus@gmail.com", "Information", MB_ICONINFORMATION);
    					return TRUE ;
     
                }
        }
        return FALSE;
     
    }
    //
    WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    {
            hInst = hInstance;
    		DialogBox(hInst,MAKEINTRESOURCE(SFX_DLG),NULL,(DLGPROC)MainProc);
            return 0;
    }
    //----------------------------------------------------------------------
    Et pour le fichier RC :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
     
    //Microsoft Developer Studio generated resource script.
    //
    #include "resource.h"
     
    #define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 2 resource.
    //
    #include "afxres.h"
     
    /////////////////////////////////////////////////////////////////////////////
    #undef APSTUDIO_READONLY_SYMBOLS
     
    /////////////////////////////////////////////////////////////////////////////
    // English (U.S.) resources
     
    #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
    #ifdef _WIN32
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    #pragma code_page(1252)
    #endif //_WIN32
     
    /////////////////////////////////////////////////////////////////////////////
    //
    // Dialog
    //
     
    SFX_DLG DIALOGEX 0, 0, 321, 207
    STYLE DS_ABSALIGN | DS_SYSMODAL | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | 
        WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "SFX SelfEXtracting ARchive - build by bSaidus"
    FONT 8, "Tahoma"
    BEGIN
        DEFPUSHBUTTON   "&GO !!!",IDC_GO,210,190,50,14,BS_FLAT
        PUSHBUTTON      "&Close",IDCLOSE,264,190,50,14,BS_FLAT
        PUSHBUTTON      "&Browse...",IDC_BROWSE,90,128,50,14,BS_FLAT
        PUSHBUTTON      "&About",IDC_ABOUT,7,190,50,14,BS_FLAT
        COMBOBOX        IDC_FOLDER,90,113,218,30,CBS_DROPDOWN | CBS_SORT | 
                        WS_VSCROLL | WS_TABSTOP
        CONTROL         "SFX ARchive EXtractor",IDC_STATIC,"Static",SS_SIMPLE | 
                        WS_GROUP,83,3,231,8
        CONTROL         "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,83,13,
                        231,1
        LTEXT           "1 . Press GO button to begin extraction. ",IDC_STATIC,
                        87,28,225,12
        LTEXT           "2 . Press Browse button to select the destination folder where the archive will be extracted. You can choose a folder manually.",
                        IDC_STATIC,87,45,225,20
        LTEXT           "3 . If the destination folder does not exist,il will b created automatocally durin the installation.",
                        IDC_STATIC,87,70,225,20
        GROUPBOX        " Destination folder :",IDC_STATIC,83,102,231,43,BS_FLAT
        LTEXT           "Progression:",IDC_REP,83,149,231,8
        CONTROL         108,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE,7,3,
                        71,177,WS_EX_STATICEDGE
        CONTROL         "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,7,184,
                        307,1
        LTEXT           "############################################",
                        IDC_STATIC,83,160,231,8
    END
     
     
    /////////////////////////////////////////////////////////////////////////////
    //
    // DESIGNINFO
    //
     
    #ifdef APSTUDIO_INVOKED
    GUIDELINES DESIGNINFO DISCARDABLE 
    BEGIN
        SFX_DLG, DIALOG
        BEGIN
            LEFTMARGIN, 7
            RIGHTMARGIN, 314
            TOPMARGIN, 3
            BOTTOMMARGIN, 201
        END
    END
    #endif    // APSTUDIO_INVOKED
     
     
    #ifdef APSTUDIO_INVOKED
    /////////////////////////////////////////////////////////////////////////////
    //
    // TEXTINCLUDE
    //
     
    1 TEXTINCLUDE DISCARDABLE 
    BEGIN
        "resource.h\0"
    END
     
    2 TEXTINCLUDE DISCARDABLE 
    BEGIN
        "#include ""afxres.h""\r\n"
        "\0"
    END
     
    3 TEXTINCLUDE DISCARDABLE 
    BEGIN
        "\r\n"
        "\0"
    END
     
    #endif    // APSTUDIO_INVOKED
     
     
    /////////////////////////////////////////////////////////////////////////////
    //
    // Bitmap
    //
     
    IDB_BITMAP              BITMAP  DISCARDABLE     "zsfxwiz22.bmp"
    #endif    // English (U.S.) resources
    /////////////////////////////////////////////////////////////////////////////
     
     
    /////////////////////////////////////////////////////////////////////////////
    // French (France) resources
     
    #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
    #ifdef _WIN32
    LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
    #pragma code_page(1252)
    #endif //_WIN32
     
    /////////////////////////////////////////////////////////////////////////////
    //
    // Bitmap
    //
     
    IDB_BITMAP1             BITMAP  DISCARDABLE     "SFXLogo.bmp"
     
    /////////////////////////////////////////////////////////////////////////////
    //
    // Icon
    //
     
    // Icon with lowest ID value placed first to ensure application icon
    // remains consistent on all systems.
    IDI_ICON                ICON    DISCARDABLE     "1.ico"
    #endif    // French (France) resources
    /////////////////////////////////////////////////////////////////////////////
     
     
     
    #ifndef APSTUDIO_INVOKED
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 3 resource.
    //
     
     
    /////////////////////////////////////////////////////////////////////////////
    #endif    // not APSTUDIO_INVOKED
    le fichier ressource.h :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
     
    //{{NO_DEPENDENCIES}}
    // Microsoft Developer Studio generated include file.
    // Used by zSFXDlg.rc
    //
    #define SFX_DLG                         101
    #define IDB_BITMAP                      103
    #define IDI_ICON                        106
    #define IDB_BITMAP1                     108
    #define IDC_GO                          1001
    #define IDC_ABOUT                       1003
    #define IDC_PB                          1005
    #define IDC_FOLDER                      1006
    #define IDC_BROWSE                      1007
    #define IDC_REP                         1011
     
    // Next default values for new objects
    // 
    #ifdef APSTUDIO_INVOKED
    #ifndef APSTUDIO_READONLY_SYMBOLS
    #define _APS_NEXT_RESOURCE_VALUE        109
    #define _APS_NEXT_COMMAND_VALUE         40001
    #define _APS_NEXT_CONTROL_VALUE         1014
    #define _APS_NEXT_SYMED_VALUE           101
    #endif
    #endif

  2. #2
    Membre confirmé Avatar de saidus
    Homme Profil pro
    Inscrit en
    Octobre 2004
    Messages
    166
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48

    Informations forums :
    Inscription : Octobre 2004
    Messages : 166
    Par défaut
    C'est bon .. c'est reglé ....
    il suffit de d'appeler la fonction
    au debut du programme..
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
     switch(message)
        {
            case WM_INITDIALOG:
    			{   /*
    				* TODO: Add code to initialize the dialog.
    				**/
    				InitCommonControls();
    				hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 32, 32, 0);
    				SendMessage(Dlg, WM_SETICON, ICON_BIG  , (LPARAM)hIcon);
    				hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
    				SendMessage(Dlg, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
    				//break;
    				return TRUE;
    			}

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [XL-2007] Probleme chargement progressbar
    Par bapt298 dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 14/09/2012, 17h35
  2. Probleme de ProgressBar
    Par bosslex dans le forum Interfaces Graphiques en Java
    Réponses: 4
    Dernier message: 26/12/2009, 11h35
  3. Probleme avec ProgressBar de Richfaces
    Par nawfal_saber dans le forum JSF
    Réponses: 1
    Dernier message: 30/07/2008, 13h45
  4. probleme avec ProgressBar
    Par k_boy dans le forum VC++ .NET
    Réponses: 8
    Dernier message: 15/09/2006, 17h19
  5. [VB.NET] [ProgressBar] Probleme de "refresh"
    Par Aspic dans le forum Windows Forms
    Réponses: 3
    Dernier message: 06/05/2006, 16h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo