Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Attrib xxx.yyy -h / Attrib xxx.yyy +h
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00088513
Message ID:
00088522
Vues:
81
>Anyone have the code for the WINAPI equivalent -- one that won't open a command window while changing the 'Hidden' attribute for a file?

Here's the declaration:
DECLARE SHORT SetFileAttributes IN Win32API;
  STRING @lpFileName, INTEGER dwFileAttributes
Now in order to set the hidden attribute of an existing file, you'd do something like this (with an additional declaration):
DECLARE INTEGER GetFileAttributes IN Win32API;
  STRING @lpFileName
#DEFINE FILE_ATTRIBUTE_HIDDEN 2
lnattribs = GetFileAttributes(@lcfile)
lnattribs = BITOR(lnattribs, FILE_ATTRIBUTE_HIDDEN)
llresult = (SetFileAttributes(@lcfile, lnattribs) # 0)
BTW, there's a class that will do this in the Files under Win 32 and other APIs.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform