title: Changing the File Creation Date in C++ using windows.h in Windows 7
body: <p>I have the following code:</p>
  
  <pre><code>int main(int argc, char** argv) {
      onelog a;
      std::cout &lt;&lt; "a new project";
  
      //creates a file as varuntest.txt
      ofstream file("C:\\users\\Lenovo\\Documents\\varuntest.txt", ios::app);
  
      SYSTEMTIME thesystemtime;
      GetSystemTime(&amp;thesystemtime);
  
      thesystemtime.wDay = 07;//changes the day
      thesystemtime.wMonth = 04;//changes the month
      thesystemtime.wYear = 2012;//changes the year
  
      //creation of a filetimestruct and convert our new systemtime
      FILETIME thefiletime;
  
      SystemTimeToFileTime(&amp;thesystemtime,&amp;thefiletime);
  
      //getthe handle to the file
      HANDLE filename = CreateFile("C:\\users\\Lenovo\\Documents\\varuntest.txt", 
                                  FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ|FILE_SHARE_WRITE,
                                  NULL, OPEN_EXISTING, 
                                  FILE_ATTRIBUTE_NORMAL, NULL);
  
      //set the filetime on the file
      SetFileTime(filename,(LPFILETIME) NULL,(LPFILETIME) NULL,&amp;thefiletime);
  
      //close our handle.
      CloseHandle(filename);
  
  
      return 0;
  }
  </code></pre>
  
  <p>Now the question is; it only changes the modified date when I check the properties of the file. I need to ask;</p>
  
  <blockquote>
    <p>How to change the file's creation date instead of the modification
    date?</p>
  </blockquote>
  
  <p>Thanks</p>
  
  <p>Please give some code for this novice.</p>