Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attrib xxx.yyy -h / Attrib xxx.yyy +h
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00088513
Message ID:
00088522
Views:
77
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform