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

VB 6 et antérieur Discussion :

Optimiser un programme VB


Sujet :

VB 6 et antérieur

  1. #1
    Membre confirmé
    Profil pro
    Ingénieur
    Inscrit en
    Janvier 2009
    Messages
    209
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur

    Informations forums :
    Inscription : Janvier 2009
    Messages : 209
    Par défaut Optimiser un programme VB
    Bonjour ,

    je viens de créer un programme qui s'exécute lors du démarrage de mon pc , mais ce que j'ai remarqué , c'est que lorsque je fais ( alt + ctrl + Supp ) et je bascule sur processus , j'ai constaté qu'il bouffe un peu trop la mémoire vive , est ce qu'il y a un moyen pour le rendre moins gourmand .

    PS :Ce programme a été fait pour supprimer tous les icons ( raccourcis ) qui se trouve sur ma machine.

    Merci d'avance

  2. #2
    Expert confirmé
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 137
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 69
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 137
    Par défaut
    Citation Envoyé par Eausport Voir le message
    Bonjour ,
    .......
    j'ai constaté qu'il bouffe un peu trop la mémoire vive , est ce qu'il y a un moyen pour le rendre moins gourmand .

    PS :Ce programme a été fait pour supprimer tous les icons ( raccourcis ) qui se trouve sur ma machine.

    Merci d'avance
    Oui en mettant beaucoup de poivre et/ou de sel dans les lignes de commande de ton programme
    Trêve de plaisanterie, que fait exactement ton programme (les commandes qui vérifient les raccourcis, combien de fois par minutes …..)
    :whistle:pourquoi pas, pour remercier, un :plusser: pour celui/ceux qui vous ont dépannés.
    saut de ligne
    OOOOOOOOO👉 → → Ma page perso sur DVP ← ← 👈

  3. #3
    Membre confirmé
    Profil pro
    Ingénieur
    Inscrit en
    Janvier 2009
    Messages
    209
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur

    Informations forums :
    Inscription : Janvier 2009
    Messages : 209
    Par défaut
    c'est un petit programme , qui me permet de lance n'importe quel exécutable ,[word , vlc .... ect , ] donc , moi j'entre le nom du programme a exécuté [sachant que je mes des nom facile par exemple pour lancer Word , il me suffit de taper "Doc" ]

    Un détail très important que je n'ai pas mentionner , afin d'enrichir ma base de données des lien a exécuté , j'ai relié avec une BBD .

    Merci

  4. #4
    Membre confirmé
    Profil pro
    Ingénieur
    Inscrit en
    Janvier 2009
    Messages
    209
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur

    Informations forums :
    Inscription : Janvier 2009
    Messages : 209
    Par défaut
    Je pense qu'il a plus faim ,

    Mais s'il y a un moyen pour l'optimiser plus , je suis preneur

  5. #5
    Expert confirmé
    Avatar de ThierryAIM
    Homme Profil pro
    Inscrit en
    Septembre 2002
    Messages
    3 673
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Secteur : Industrie

    Informations forums :
    Inscription : Septembre 2002
    Messages : 3 673
    Par défaut
    Ne pas confondre gourmand en mémoire et gourmand en ressources processeur
    Les fuites de mémoire peuvent être d'origines diverses, mais bien souvent dues à la non destruction des objets

  6. #6
    Membre confirmé
    Profil pro
    Ingénieur
    Inscrit en
    Janvier 2009
    Messages
    209
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur

    Informations forums :
    Inscription : Janvier 2009
    Messages : 209
    Par défaut
    Y a t il une solution ?

  7. #7
    Membre habitué
    Inscrit en
    Octobre 2008
    Messages
    13
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 13
    Par défaut Mémoire et Processus
    A moins que tu voudrais garder ton programme secret envoi le pour qu'on puisse l'étudier et voir ou se trouve la fuite.

    En règle générale :
    - quand tu déclare une variable :> tu consomme de la mémoire, cette mémoire est aussitôt libéré après la destruction de la variable .
    - quand tu fait un traitement (par exemple Boucle, calcul, affichage...) :> tu consomme des ressources processeur.

  8. #8
    Membre confirmé
    Profil pro
    Ingénieur
    Inscrit en
    Janvier 2009
    Messages
    209
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur

    Informations forums :
    Inscription : Janvier 2009
    Messages : 209
    Par défaut
    Voici le Code complet

    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
     
    Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
    Private dx As Integer, dy As Integer, dwn As Integer
    Private Type POINTAPI
        X As Long
        Y As Long
    End Type
     
    Private Sub Command3_Click()
        End
    End Sub
     
    Private Sub Form_MouseDown(button As Integer, Shift As Integer, X As Single, Y As Single)
        dx = X
        dy = Y
        dwn = True
        If button = 2 Then
            PopupMenu mnuflotant
        End If
    End Sub
    Private Sub Form_MouseMove(button As Integer, Shift As Integer, X As Single, Y As Single)
        If dwn Then
            Move Left + (X - dx), Top + (Y - dy)
            u% = DoEvents
        End If
    End Sub
    Private Sub Form_MouseUp(button As Integer, Shift As Integer, X As Single, Y As Single)
        dwn = False
    End Sub
    Private Sub cmdbt_Click()
        Command1.Visible = True
        DG.Visible = True
        Me.Height = 3435
        cmdcach.Visible = True
        cmdbt.Visible = False
    End Sub
    Private Sub cmdcach_Click()
        Command1.Visible = False
        DG.Visible = False
        Me.Height = 1110
        cmdbt.Visible = True
        cmdcach.Visible = False
    End Sub
     
    Private Sub cmdexe_Click()
        On Error GoTo err
        Dim varbookmarks As Variant
        larecherche = txtch
        varbookmarks = Adodc1.Recordset.Bookmark
        Adodc1.Recordset.Find "Nom='" & larecherche & "'"
        If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then
            Adodc1.Recordset.Bookmark = varbookmarks
            If opt.Value = 0 Then
                Label1.Caption = "C:\Program Files\"
                Label3 = txtch & "\"
                Label1.Caption = Label1 & Label3 & txtch & Label2
            Else
                Adodc1.Recordset.Update
            End If
            Shell (Label1)
            Exit Sub
        Else
            Shell (txtchemin)
        End If
        txtch = ""
        txtch.SetFocus
        opt.Value = 0
        Adodc1.Refresh
        Exit Sub
    err:
        MsgBox "Veuillez définir le chemain correctement !!", vbInformation, "Aide"
    End Sub
     
    Private Sub Command1_Click()
        On Error Resume Next
        Adodc1.Recordset.Delete
    End Sub
     
    Private Sub Command2_Click()
        If Command2.Caption = ">" Then
            Me.Width = 300
            Me.Left = Screen.Width - Me.Width
            Command2.Caption = "<"
        Else
            Me.Width = 4140
            Me.Left = Screen.Width - Me.Width
            Command2.Caption = ">"
        End If
        txtch.SetFocus
    End Sub
     
    Private Sub Form_Load()
        Me.Left = Screen.Width - Me.Width
        Me.Width = 4140
    End Sub
     
    Private Sub Label1_Change()
        If opt.Value = 1 Then
            txtchemin.Text = Label1.Caption
        End If
    End Sub
    Private Sub mnupro_Click()
        MsgBox "Ce programme a été realisé par Islem", vbInformation, "A propos"
    End Sub
     
    Private Sub mnuquit_Click()
        End
    End Sub
     
    Private Sub Opt_Click()
        If opt.Value = 0 Then
            cmdpar.Enabled = False
            txtch.SetFocus
            Adodc1.Refresh
        Else
            cmdpar.Enabled = True
            Adodc1.Recordset.AddNew
            txtch = ""
            txtch.SetFocus
        End If
    End Sub
     
    Private Sub cmdpar_Click()
        cd.InitDir = "\Program Files"
        cd.Filter = "Fichers(*.exe)|*.exe"
        cd.ShowOpen
        Label1 = cd.FileName
    End Sub
    Private Sub txtch_Change()
        If opt.Value = 1 Then
            txtnom = txtch
        End If
    End Sub

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

Discussions similaires

  1. Comment optimiser mon programme
    Par fouedou77 dans le forum C
    Réponses: 2
    Dernier message: 29/06/2009, 10h51
  2. [Macro] optimisation de programmes SAS
    Par bar_79 dans le forum Macro
    Réponses: 4
    Dernier message: 25/11/2008, 16h51
  3. Optimiser des programmes .net
    Par TSalm dans le forum Général Dotnet
    Réponses: 4
    Dernier message: 06/03/2008, 13h19
  4. Optimiser un programme java
    Par piteon dans le forum Général Java
    Réponses: 27
    Dernier message: 05/08/2007, 21h01
  5. Réponses: 9
    Dernier message: 07/11/2006, 15h12

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