Abaixo alguns exemplos do uso da Classe WinAPI, para queles que não sabem o que é API: Application Programming Interface ou Interface de Programação de Aplicativos.:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
static void FO_WinApi(Args _args)
{
  str     root        = "C:";
  str     path        = "C:\\temp";
  str     fileName    = "Test.pdf";
  str     fileName2   = "Test2.pdf";
  str     file        = path + "\\" + fileName;
  str     file2       = path + "\\" + fileName2;
  int     x, y;
  ;
 
  // Does folder exist?
  print WinAPI::folderExists(path);
 
  // Does file exist?
  print WinAPI::fileExists(file);
 
  // Copy file.
  print WinAPI::copyFile(file,file2);
 
  // New file exists?
  print WinAPI::fileExists(file2);
 
  // Delete new file.
  print WinAPI::deleteFile(file2);
 
  // New file still there?
  print WinAPI::fileExists(file2);
 
  // Get current cursor position.
  [x, y] = WinAPI::getCursorPos();
 
  print x;
  print y;
 
  // Get time and date format.
  print WinAPI::getSystemLocaleDateStr();
  print WinAPI::getSystemLocaleTimeStr();
 
  // Gets current computer name.
  print WinAPI::getComputerName();
 
  // Gets total disk space.
  print int2str(WinAPI::getDiskTotalSpaceInKb(root) 
         / 1000) + " MB";
 
  // Gets current free space on disk.
  print int2str(WinAPI::getDiskFreeSpaceInKb(root)
         / 1000) + " MB";
 
  // Date when file was last accessed.
  print WinAPI::getFileAccessedDate(file);
 
  // Time when file was last accessed(In seconds).
  print WinAPI::getFileAccessedTime(file);
 
  // Gets path to temp directory.
  print WinAPI::getTempPath();
 
  // Gets a generated temporary filename, prefix "FO_".
  print WinAPI::getTempFilename(path, "FO_");
 
  pause;
}

[]s
Pichler

Fonte: http://www.fourone.se/blog/2008/01/25/class-winapi/