bonjour,
j'utilise la fonction GetWindowsDirectory pour obtenir le chemin du répertoire windows sur Windows mais cette fonction ne fonctionne pas sous Pocket PC, quel est l'équivalent ?
merci,
;)
Version imprimable
bonjour,
j'utilise la fonction GetWindowsDirectory pour obtenir le chemin du répertoire windows sur Windows mais cette fonction ne fonctionne pas sous Pocket PC, quel est l'équivalent ?
merci,
;)
on en parlait justement, t'as testé de charger dynamiquement la dll pour utiliser l'API ?
Sinon, est-ce que les fonctions du shell (genre SHGetSpecialFolderPath() et ses soeurs, qui pourraient t'être utiles) sont présentes ?
charger dynamiquement quelle DLL Nico ?
tente voir un truc comme ca :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 typedef UINT (WINAPI *fGetWindowsDirectory)(LPTSTR, UINT); int main() { HINSTANCE instance_kernel32 = NULL; fGetWindowsDirectory pGetWindowsDirectory = NULL; instance_kernel32 = LoadLibrary(L"kernel32.dll"); if (instance_kernel32) { pGetWindowsDirectory = (fGetWindowsDirectory) GetProcAddress (instance_kernel32, "GetWindowsDirectoryW"); if (pGetWindowsDirectory) { TCHAR windowsDirectory[MAX_PATH]; pGetWindowsDirectory(windowsDirectory, MAX_PATH); } } }
C'est quoi comme type de projet ?
euh là, en l'occurence, c'est un projet console, mais c'est pour le principe
tu définis le typedef
et ensuite tu mets ce que j'ai mis dans le main à l'endroit où tu veux récupérer le répertoire
et ensuite tu regardes ce qu'il y a dans la variable windowsDirectory
en tout cas dans un projet embedded ou visual C++ ca ne compile pas =).
Ca sert à quoi ton truc ?
qu'est-ce qui ne compile pas ? quelle erreur ? montre le code
Ou alors quel est le chemin Windows par défaut sur Pocket PC ?
Citation:
Envoyé par Médinoc
oui cette fonction est disponible a partir de wince 2.12.
bon, personne ne veut tester la solution avec loadlibrary ? comment est-ce que je satisfais ma curiosité moi ? :mrgreen:
j'ai essayé rapidement ce matin,
LoadLibrary renvoie NULL , j'ai pas trop le temps d'aller plus loin l'instant.
des que j'ai du neuf je ferais signe.
:D
char mesDocumentsPath[MAX_PATH];
SHGetSpecialFolderPath(0,mesDocumentsPath,CSIDL_PERSONAL,0);
char applicationData[MAX_PATH];
SHGetSpecialFolderPath(0,applicationData,CSIDL_COMMON_APPDATA,0);
char bureau[MAX_PATH];
SHGetSpecialFolderPath(0,bureau,CSIDL_DESKTOPDIRECTORY,0);
char favoris[MAX_PATH];
SHGetSpecialFolderPath(0,favoris,CSIDL_FAVORITES,0);
char maMusique[MAX_PATH];
SHGetSpecialFolderPath(0,maMusique,CSIDL_MYMUSIC,0);
char mesImages[MAX_PATH];
SHGetSpecialFolderPath(0,mesImages,CSIDL_MYPICTURES,0);
char profile[MAX_PATH];
SHGetSpecialFolderPath(0,profile,CSIDL_PROFILE,0);
char programFiles[MAX_PATH];
SHGetSpecialFolderPath(0,programFiles,CSIDL_PROGRAM_FILES,0);
char sendTo[MAX_PATH];
SHGetSpecialFolderPath(0,sendTo,CSIDL_SENDTO,0);
Voilà les répertoires trouvés dans la FAQ C de Developpez.com, mais pas notre ami le répertoire Windows :?
char windows[MAX_PATH];
SHGetSpecialFolderPath(0,windows,CSIDL_WINDOWS,0);
ce n'était pas exhaustif, la msdn t'aurait dit d'utiliser CSIDL_WINDOWS
Problème on ne peut pas avoir le répertoire Windows pour Pocket PC, voici la liste :
Citation:
CSIDL_BITBUCKET File system directory that contains file objects in the user's Recycle Bin. The location of this directory is not in the registry; it is marked with the hidden and system attributes to prevent the user from moving or deleting it.
CSIDL_CONTROLS Virtual folder containing icons for Control Panel applications.
CSIDL_DESKTOP Windows CE Desktop, which is a virtual folder at the root of the namespace.
CSIDL_DESKTOPDIRECTORY File system directory used to physically store file objects on the desktop, which is not to be confused with the desktop folder itself.
CSIDL_DRIVES My Computer, which is a virtual folder that contains everything on the local computer: storage devices, printers, and Control Panel. The folder can also contain mapped network drives.
CSIDL_FAVORITES File system directory that serves as a common repository for the user's favorite items.
CSIDL_FONTS Virtual folder containing fonts.
CSIDL_NETHOOD File system directory containing objects that appear in the network neighborhood.
CSIDL_NETWORK Network Neighborhood Folder, which is a virtual folder that represents the top level of the network hierarchy.
CSIDL_PERSONAL File system directory that serves as a common repository for documents.
CSIDL_PRINTERS Virtual folder containing installed printers.
CSIDL_PROFILE Folder that contains the profile of the user.
CSIDL_PROGRAMS File system directory that contains the user's program groups, which are also file system directories.
CSIDL_RECENT File system directory that contains the user's most recently used documents.
CSIDL_SENDTO File system directory that contains Send To menu items.
CSIDL_STARTMENU File system directory containing Start menu items.
CSIDL_STARTUP File system directory that corresponds to the user's Startup program group. The system starts these programs when a device is powered on.
CSIDL_TEMPLATES File system directory that serves as a common repository for document templates.
Ben, quelle est ta version?
Dans celle-ci (/wceshellui5) j'ai CSIDL_WINDOWS :
http://msdn.microsoft.com/library/de...FolderPath.asp
Dans /wceui40 aussi:
http://msdn.microsoft.com/library/de...folderpath.asp
Et je n'en vois pas d'autre sur MSDN (à part celle du Windows normal).
Je Développe avec Embedded Visual C++ SP4 pour Pocket PC 2003 ( après je passerai mon code en mobile 5.0).
L'erreur que j'ai :
Code :Citation:
error C2664: 'SHGetSpecialFolderPath' : cannot convert parameter 2 from 'char [260]' to 'unsigned short *'
;)Citation:
static char windows[MAX_PATH];
bool a=SHGetSpecialFolderPath(0,windows,CSIDL_WINDOWS,0);