Difference between revisions of "Truxton media set created"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This sets the creation date of the media. This corresponds to the <code>Created</code> column of the <code>Media</code> table. =Syntax= <syntaxhighlight lang="C"> void truxto...")
 
Line 1: Line 1:
 
This sets the creation date of the media.
 
This sets the creation date of the media.
This corresponds to the <code>Created</code> column of the <code>Media</code> table.
+
This corresponds to the <code>[Created]</code> column of the <code>[Media]</code> table.
  
 
=Syntax=
 
=Syntax=
<syntaxhighlight lang="C">
+
<source lang="C">
 
void truxton_media_set_created( uint64_t media_handle, uint64_t ticks );
 
void truxton_media_set_created( uint64_t media_handle, uint64_t ticks );
</syntaxhighlight>
+
</source>
  
 
=Parameters=
 
=Parameters=
Line 11: Line 11:
 
The handle created by the [[truxton_media_open_id]] or [[truxton_media_create]] call.
 
The handle created by the [[truxton_media_open_id]] or [[truxton_media_create]] call.
  
==<code>ticks </code>==
+
==<code>ticks</code>==
 
The date in [https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime FILETIME] ticks.
 
The date in [https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime FILETIME] ticks.
  
 
=Sample=
 
=Sample=
<syntaxhighlight lang="C" highlight="12">
+
<source lang="C" highlight="12">
 
void set_created(uint64_t media)
 
void set_created(uint64_t media)
 
{
 
{
Line 29: Line 29:
 
   truxton_media_set_created(media, ticks.QuadPart);
 
   truxton_media_set_created(media, ticks.QuadPart);
 
}
 
}
</syntaxhighlight>
+
</source>

Revision as of 03:47, 13 November 2020

This sets the creation date of the media. This corresponds to the [Created] column of the [Media] table.

Syntax

void truxton_media_set_created( uint64_t media_handle, uint64_t ticks );

Parameters

media_handle

The handle created by the truxton_media_open_id or truxton_media_create call.

ticks

The date in FILETIME ticks.

Sample

void set_created(uint64_t media)
{
   FILETIME now;

   GetSystemTimeAsFileTime(&now);

   ULARGE_INTEGER ticks;

   ticks.LowPart = now.dwLowDateTime;
   ticks.HighPart = now.dwHighDateTime;

   truxton_media_set_created(media, ticks.QuadPart);
}