Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
783 connectés 

  FORUM HardWare.fr
  Programmation

  [VB] récupàrer le répertoire du menu démarrer

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[VB] récupàrer le répertoire du menu démarrer

n°122310
MoRp][eUs
<img src='morp][eus.gif'>
Posté le 05-04-2002 à 20:10:28  profilanswer
 

Salut a tous  
j'aimerais bien pour un de mes programme pouvoir savoir dans quel répertoire repertoire ce trouve le menu démarrer mais je ne sais pas comment faire il fo que la fonction aille sous nt/2k/xp et 9x/me
pour le rép win ou system pas de pb mais le menu démarrer j'arrive pas  
 
HELP ME PLEASE ...
 
 :hello:


---------------
L'Internet serait une toile comme les autres si elle n'avait ses millions d'araignées ...
mood
Publicité
Posté le 05-04-2002 à 20:10:28  profilanswer
 

n°127230
Ratchi51
Posté le 17-04-2002 à 16:08:42  profilanswer
 

Je ne pense que le chemin d'accès est différent pour certain OS mais pour win 9x le chemin est : c:\windows\menu démarer
 [:warkangel]


---------------
[:warkangel] Chassé du paradis, l'ange déchu n'a pas d'autre choix que de devenir démon pour survivre en enfer  [:warkangel]    
n°127234
MoRp][eUs
<img src='morp][eus.gif'>
Posté le 17-04-2002 à 16:13:24  profilanswer
 

Justement moi je veux trouver le chemin sur n'importe quelle OS et aussi sous les système NT celui du compte qui est loggé et la ca change tout le problème ...


---------------
L'Internet serait une toile comme les autres si elle n'avait ses millions d'araignées ...
n°127306
Lord II
PIB2000
Posté le 17-04-2002 à 17:14:32  profilanswer
 

Je me demande s'il n'y a pas moyen d'utiliser une des variables que le systeme stock ( genre %SYSTEM% qui indique le rep sys, etc...)
Je ne sais pas si le menu demarer fait partie de ces variables, je te laisse chercher

n°127423
HappyHarry
Posté le 17-04-2002 à 20:07:39  profilanswer
 

tu detectes le type d'OS : 9x ou NT
si c un 9x : window\menu demarrer
si c un NT :  
tu recuperes le nom de l'utilisateur
et le rep est documents and settings\ton user\menu demarrer

n°127469
Un4GivN
Posté le 17-04-2002 à 21:16:22  profilanswer
 

je suis p-e en train de me gourrer, mais je crois que la variable d'environnement de dos %windir% est très bien aussi. Il n'y a qu'à rajouter "\menu démarrer".
 
Pour NT dsl je ne connais pas encore son fonctionnement.

n°127470
cerdoc
Comment l'AK47 à changé ma vie
Posté le 17-04-2002 à 21:16:59  profilanswer
 
n°127504
Kyle_Katar​n
Posté le 17-04-2002 à 22:23:00  profilanswer
 

y'a effectivement un API qui permet de le faire (son nom m'échappe)

n°127641
Lord II
PIB2000
Posté le 18-04-2002 à 10:48:08  profilanswer
 

HappyHarry a écrit a écrit :

tu detectes le type d'OS : 9x ou NT
si c un 9x : window\menu demarrer
si c un NT :  
tu recuperes le nom de l'utilisateur
et le rep est documents and settings\ton user\menu demarrer  




 
La méthode pour NT ne marche qu'à partir de 2000. POur NT4 c'est pas ca c'est winnt/profiles/nom utilisateur

n°128028
HelloWorld
Salut tout le monde!
Posté le 18-04-2002 à 16:59:10  profilanswer
 

Et "menu demarrer", ca ne marche que sur un Windows francais ...


---------------
FAQ fclc++ - FAQ C++ - C++ FAQ Lite
mood
Publicité
Posté le 18-04-2002 à 16:59:10  profilanswer
 

n°128150
MoRp][eUs
<img src='morp][eus.gif'>
Posté le 18-04-2002 à 21:51:42  profilanswer
 

merci a tous mais effectivement je veux ke mon prog "marche" sur n'import kel os bon pas forcément en dessous de win nt4
mais il fo bien sur ke les os anglais soi tenu en compte et je veux pas le rép système non le rép windows mais le rép du menu démarrer cerdoc


---------------
L'Internet serait une toile comme les autres si elle n'avait ses millions d'araignées ...
n°128241
tegu
Posté le 19-04-2002 à 08:43:07  profilanswer
 

Voici un exemple tiré de www.allapi.net
Ca devrait répondre aux questions sur le sujet
 
Const CSIDL_DESKTOP = &H0
Const CSIDL_PROGRAMS = &H2
Const CSIDL_CONTROLS = &H3
Const CSIDL_PRINTERS = &H4
Const CSIDL_PERSONAL = &H5
Const CSIDL_FAVORITES = &H6
Const CSIDL_STARTUP = &H7
Const CSIDL_RECENT = &H8
Const CSIDL_SENDTO = &H9
Const CSIDL_BITBUCKET = &HA
Const CSIDL_STARTMENU = &HB
Const CSIDL_DESKTOPDIRECTORY = &H10
Const CSIDL_DRIVES = &H11
Const CSIDL_NETWORK = &H12
Const CSIDL_NETHOOD = &H13
Const CSIDL_FONTS = &H14
Const CSIDL_TEMPLATES = &H15
Const MAX_PATH = 260
Private Type SHITEMID
    cb As Long
    abID As Byte
End Type
Private Type ITEMIDLIST
    mkid As SHITEMID
End Type
Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hWnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    'Show an about window
    ShellAbout Me.hWnd, App.Title, "Created by the KPD-Team 1999", ByVal 0&
    'Set the graphical mode to persistent
    Me.AutoRedraw = True
    'Print the folders to the form
    Me.Print "Start menu folder: " + GetSpecialfolder(CSIDL_STARTMENU)
    Me.Print "Favorites folder: " + GetSpecialfolder(CSIDL_FAVORITES)
    Me.Print "Programs folder: " + GetSpecialfolder(CSIDL_PROGRAMS)
    Me.Print "Desktop folder: " + GetSpecialfolder(CSIDL_DESKTOP)
End Sub
Private Function GetSpecialfolder(CSIDL As Long) As String
    Dim r As Long
    Dim IDL As ITEMIDLIST
    'Get the special folder
    r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
    If r = NOERROR Then
        'Create a buffer
        Path$ = Space$(512)
        'Get the path from the IDList
        r = SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal Path$)
        'Remove the unnecessary chr$(0)'s
        GetSpecialfolder = Left$(Path, InStr(Path, Chr$(0)) - 1)
        Exit Function
    End If
    GetSpecialfolder = ""
End Function

n°128256
Kyle_Katar​n
Posté le 19-04-2002 à 09:07:59  profilanswer
 

voilà

n°128400
MoRp][eUs
<img src='morp][eus.gif'>
Posté le 19-04-2002 à 11:12:45  profilanswer
 

tegu a écrit a écrit :

Voici un exemple tiré de www.allapi.net
Ca devrait répondre aux questions sur le sujet
 
Const CSIDL_DESKTOP = &H0
Const CSIDL_PROGRAMS = &H2
Const CSIDL_CONTROLS = &H3
Const CSIDL_PRINTERS = &H4
Const CSIDL_PERSONAL = &H5
Const CSIDL_FAVORITES = &H6
Const CSIDL_STARTUP = &H7
Const CSIDL_RECENT = &H8
Const CSIDL_SENDTO = &H9
Const CSIDL_BITBUCKET = &HA
Const CSIDL_STARTMENU = &HB
Const CSIDL_DESKTOPDIRECTORY = &H10
Const CSIDL_DRIVES = &H11
Const CSIDL_NETWORK = &H12
Const CSIDL_NETHOOD = &H13
Const CSIDL_FONTS = &H14
Const CSIDL_TEMPLATES = &H15
Const MAX_PATH = 260
Private Type SHITEMID
    cb As Long
    abID As Byte
End Type
Private Type ITEMIDLIST
    mkid As SHITEMID
End Type
Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hWnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    'Show an about window
    ShellAbout Me.hWnd, App.Title, "Created by the KPD-Team 1999", ByVal 0&
    'Set the graphical mode to persistent
    Me.AutoRedraw = True
    'Print the folders to the form
    Me.Print "Start menu folder: " + GetSpecialfolder(CSIDL_STARTMENU)
    Me.Print "Favorites folder: " + GetSpecialfolder(CSIDL_FAVORITES)
    Me.Print "Programs folder: " + GetSpecialfolder(CSIDL_PROGRAMS)
    Me.Print "Desktop folder: " + GetSpecialfolder(CSIDL_DESKTOP)
End Sub
Private Function GetSpecialfolder(CSIDL As Long) As String
    Dim r As Long
    Dim IDL As ITEMIDLIST
    'Get the special folder
    r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
    If r = NOERROR Then
        'Create a buffer
        Path$ = Space$(512)
        'Get the path from the IDList
        r = SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal Path$)
        'Remove the unnecessary chr$(0)'s
        GetSpecialfolder = Left$(Path, InStr(Path, Chr$(0)) - 1)
        Exit Function
    End If
    GetSpecialfolder = ""
End Function  




 
 
merci  
c'est meme plus que ce ke je demandais mais c parfait ton exemple


---------------
L'Internet serait une toile comme les autres si elle n'avait ses millions d'araignées ...

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  [VB] récupàrer le répertoire du menu démarrer

 

Sujets relatifs
Demarrer plusieurs programmes en même temps[Script] Renommer tous les fichiers d'un répertoire
Menu flottants...[PHP] renommer un repertoire
[Premier pas en delphi] InputQuery ??? , Creation d'un menu???Java - Repertoire d'execution
PB menu déroulant ; ouvrir dans une nouvelle fenetre pleasePerl - tester l'existance d'un fichier/repertoire
[delphi] modification de menu[Javascript] Comment demarrer avec une page en popup
Plus de sujets relatifs à : [VB] récupàrer le répertoire du menu démarrer


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR