
' MinWin
' 12:53 19/06/2011
' 21:01 14/03/2017
' 16:14 10/03/2018
' 13:28 05/04/2018

' Charles Pegge


'types
'http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

  uses windata

  '=========================
  'UNPROTOTYPED DECLARATIONS
  '=========================

  extern lib "Kernel32.dll"
  ! GetCurrentProcess                                '0
  ! GlobalAlloc                                      '2 flags 0x40,bytes
  ! GlobalReAlloc                                    '3
  ! GlobalFree                                       '1 handle
  ! GlobalLock                                       '1
  ! GlobalUnlock                                     '1
  ! HeapCreate                                       '3
  ! HeapDestroy                                      '1
  ! HeapAlloc                                        '3
  ! HeapFree                                         '3
  ! GetTickCount                                     '0
  ! QueryPerformanceCounter                          '1
  ! QueryPerformanceFrequency                        '1
  ! AllocConsole                                     '0
  ! AttachConsole                                    '1
  ! FreeConsole                                      '0
  ! SetConsoleTitle        "SetConsoleTitleA"        '1
  ! GetConsoleMode                                   '2
  ! SetConsoleMode                                   '2
  ! ReadConsoleInput       "ReadConsoleInputA"       '4
  ! GetCommandLine         "GetCommandLineA"         '0
  ! GetEnvironmentStrings  "GetEnvironmentStringsA"  '0
  ! FreeEnvironmentStrings "FreeEnvironmentStringsA" '1
  ! GetEnvironmentVariable "GetEnvironmentVariableA" '3
  ! SetEnvironmentVariable "SetEnvironmentVariableA" '2
  ! GetModuleHandle        "GetModuleHandleA"        '1
  ! GetModuleFileName      "GetModuleFileNameA"      '3
  ! GetStdHandle                                     '1
  ! GetLastError                                     '0
  ! SetLastError                                     '1
  ! CreateProcess          "CreateProcessA"          '10
  ! GetExitCodeProcess                               '2
  ! ExitProcess                                      '1
  ! Sleep                                            '1
  ! CreatePipe                                       '4
  ! CreateThread                                     '6
  ! WaitForMultipleObjects                           '4
  ! CloseHandle                                      '1
  ! FindFirstFile           "FindFirstFileA"         '2
  ! FindNextFile            "FindNextFileA"          '2
  ! FindClose                                        '1
  ! CreateFile              "CreateFileA"            '7
  ! ReadFile                                         '5
  ! WriteFile                                        '5
  ! DeleteFile              "DeleteFileA"            '1
  ! CreateDirectory         "CreateDirectoryA"       '1
  ! RemoveDirectory         "RemoveDirectoryA"       '1
  ! SetHandleInformation                             '3
  ! GetFullPathName         "GetFullPathNameA"       '4
  ! GetCurrentDirectory     "GetCurrentDirectoryA"   '2
  ! SetCurrentDirectory     "SetCurrentDirectoryA"   '1
  ! BeginUpdateResource     "BeginUpdateResourceA"   '2
  ! UpdateResource          "UpdateResourceA"        '6
  ! EndUpdateResource       "EndUpdateResourceA"     '2
  end extern


  extern lib "User32.dll"
  ! LoadIcon              "LoadIconA"             '2
  ! LoadCursor            "LoadCursorA"           '2
  ! LoadImage             "LoadImageA"            '6
  ! RegisterClass         "RegisterClassA"        '1
  ! RegisterClassEx       "RegisterClassExA"      '1
  ! UnregisterClass       "UnregisterClassA"      '1
  ! ShowCursor                                    '1
  ! MessageBox            "MessageBoxA"           '1
  ! MessageBoxW           "MessageBoxW"           '1
  ! CreateWindowEx        "CreateWindowExA"       '12
  ! ShowWindow                                    '2
  ! UpdateWindow                                  '1
  ! AdjustWindowRectEx                            '4
  ! GetMessage            "GetMessageA"           '4
  ! PeekMessage           "PeekMessageA"          '5
  ! TranslateAccelerator                          '3
  ! TranslateMessage                              '1
  ! DispatchMessage       "DispatchMessageA"      '1
  ! PostQuitMessage                               '1
  ! BeginPaint                                    '2
  ! EndPaint                                      '2
  ! GetClientRect                                 '2  
  ! GetWindowRect                                 '2  
  ! GetCursorPos                                  '1
  ! ScreenToClient                                '2
  ! DrawText              "DrawTextA"             '5
  ! PostMessage           "PostMessageA"          '4
  ! DefWindowProc         "DefWindowProcA"        '4
  ! EnumChildWindows                              '3
  ! MoveWindow                                    '6
  ! DestroyWindow                                 '1
  ! FillRect                                      '3
  ! GetDC                                         '1
  ! GetWindowDC                                   '1
  ! ReleaseDC                                     '2
  ! SetTimer                                      '4
  ! KillTimer                                     '2
  ! GetCapture                                    '0
  ! ReleaseCapture                                '0
  ! SetCapture                                    '1
  ! GetAsyncKeyState                              '1
  ! InvalidateRect                                '3
  ! ValidateRect                                  '2
  ! SendMessage           "SendMessageA"          '4
  ! GetSystemMetrics                              '1
  ! EmptyClipboard                                '0
  ! OpenClipboard                                 '1
  ! CloseClipboard                                '1
  ! GetClipboardData                              '1
  ! SetClipboardData                              '2
  ! GetFocus                                      '0
  ! SetFocus                                      '1
  ! SetWindowText         "SetWindowTextA"        '2
  ! SetWindowPos                                  '7
  ! SetForegroundWindow                           '1
  ! EnumDisplaySettings   "EnumDisplaySettingsA"  '3
  ! ChangeDisplaySettings "ChangeDisplaySettingsA"'2
  ! LoadAccelerators      "LoadAcceleratorsA"     '2
  ! DialogBoxParam        "DialogBoxParamA"       '5
  ! EndDialog                                     '2
  ! CreateMenu                                    '0
  ! InsertMenu             "InsertMenuA"          '5
  ! CreatePopupMenu                               '0
  ! TrackPopupMenu                                '7
  ! DestroyMenu                                   '1
  ! GetMenu                                       '1
  ! GetSystemMenu                                 '0
  ! SetMenu                                       '2
  ! GetSubMenu                                    '2
  ! AppendMenu            "AppendMenuA"           '4
  ! CheckMenuItem                                 '3 
  ! EnableMenuItem                                '3
  ! SetLayeredWindowAttributes                    '4
  ! GetWindowLong    "GetWindowLongA"             '2
  ! SetWindowLong    "SetWindowLongA"             '3
  #if sizeof sys = 8
  ! GetWindowLongPtr "GetWindowLongPtrA"          '2
  ! SetWindowLongPtr "SetWindowLongPtrA"          '3
  #endif
  end extern


  extern lib "GDI32.dll"
  ! CreateCompatibleDC                            '2
  ! CreateCompatibleBitmap                        '3
  ! DeleteDC                                      '1
  ! BitBlt                                        '9
  ! SetBkColor                                    '4
  ! SetTextColor                                  '4
  ! GetStockObject                                '1
  ! CreateSolidBrush                              '1
  ! ChoosePixelFormat                             '2
  ! SetPixelFormat                                '3
  ! SelectObject                                  '2
  ! DeleteObject                                  '1
  ! SwapBuffers                                   '1
  ! GetPixel                                      '4
  ! SetPixel                                      '4
  ! CreateFont          "CreateFontA"             '14
  ! CreateFontIndirect  "CreateFontIndirectA"     '1
  ! TextOut             "TextOutA"                '5
  ! GetTextMetrics      "GetTextMetricsA"         '2
  end extern


  extern lib "Comctl32.dll"
  ! InitCommonControlsEx                          '1
  end extern

  
  extern lib "shell32.dll"  
  ! ShellExecute "ShellExecuteA" (sys hwnd, string lpOperation,lpFile,
    lpParameters,lpDirectory, sys nShowCmd) As Long
  ! DragQueryFile Alias "DragQueryFileA" ( _
    sys wHandle, NumFiles, NameBuffer,BufferLen ) As sys
  ! DragFinish Alias "DragFinish" (sys wHandle)
  ! DragAcceptFiles Alias "DragAcceptFiles" (sys hWnd, fAccept )
  end extern

  uses WinData

