How to change folder's date of creation?

How to change folder's date of creation?
Last edited on
closed account (iGLbpfjN)
SetFileTime
https://msdn.microsoft.com/pt-br/library/windows/desktop/ms724933(v=vs.85).aspx

SetFileAttributes
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365535(v=vs.85).aspx
Thanx, I already got attributes to work. Now I only need to change the time. I cannot change the time in the folder for some reason although I can in file. I need a bit more help. Look at the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int main()
{
   
   SYSTEMTIME thesystemtime;
   
   GetSystemTime(&thesystemtime);
   
  
   FILETIME thefiletime;
   SystemTimeToFileTime(&thesystemtime,&thefiletime);

   
  HANDLE filename = SetFileAttributes("C:\\Flower", FILE_ATTRIBUTE_NORMAL);
   SetFileTime(filename,&thefiletime,&thefiletime,&thefiletime);

   return 0;
}

I'm getting error: invalid conversion from 'BOOL {aka int}' to 'HANDLE {aka void*}' [-fpermissive]
Last edited on
closed account (iGLbpfjN)
Sorry, I'm barely new to API functions, so I cannot solve your problem...
The only thing I can say is that you there is no way of direct assign a bool value (SetFileAttributes) with a handle value (filename).
No problem, I figured out the similar way to do that.
Topic archived. No new replies allowed.