
' A complete list of virtual keycodes can be found at: https://msdn.microsoft.com/de-de/library/windows/desktop/dd375731%28v=vs.85%29.aspx


' Gets the handle of the dll file (don't mess with this)
Local DllHandle:Int  = LoadLibraryA("bmWin32.dll")

' Checks if a key was or is currently pressed
Global isKeyDown:Int(vkey:Int)"Win32" = GetProcAddress(DllHandle,"isKeyDown")
' Performs a keystroke
Global pressKey(vkey:Int)"Win32" = GetProcAddress(DllHandle,"pressKey")
' Presses and keeps pressing a key
Global keybdDown(vkey:Int)"Win32" = GetProcAddress(DllHandle,"keybdDown")
' Releases a pressed key (see: "keybdDown")
Global keybdRelease(vkey:Int)"Win32" = GetProcAddress(DllHandle,"keybdRelease")
' Sets the cursor to the specified x and y coordinates
Global setMousePos(x:Int, y:Int)"Win32" = GetProcAddress(DllHandle,"setMousePos")
' Currently not working (x and y is always zero)
Global getMousePos:Int(x:Int Var, y:Int Var)"Win32" = GetProcAddress(DllHandle,"getMousePos")

' Sets a window with the given name(title text) as foreground window
Global setForegroundWnd:Int(name:String)"Win32" = GetProcAddress(DllHandle,"setForegroundWnd")
' Gets the handle of the currend foreground window
Global getForegroundWnd:Int()"Win32" = GetProcAddress(DllHandle,"getForegroundWnd")
' Gets the title text of the current foreground window
Global getForegroundWindowText:String()"Win32" = GetProcAddress(DllHandle,"getForegroundWindowText")
' Gets the title text of the window passed as hwnd
Global getWindowText:String(hwnd:Int)"Win32" = GetProcAddress(DllHandle,"getWindowText")

' Reads a pixel at the given x and y coordinates and stores the rgb-values into the passed arguments red, green and blue
Global getPixel(x:Int, y:Int, red:Byte Var, green:Byte Var, blue:Byte Var)"Win32" = GetProcAddress(DllHandle,"getPixel")

' Gets a process by it's name (e.g. "example.exe") buffsize must be 0!
Global getProcessByName:Int[](name:String, buffsize:Int)"Win32" = GetProcAddress(DllHandle,"getProcessByName")
' Gets the name of the given process id
Global getProcessName:String(pid:Int)"Win32" = GetProcAddress(DllHandle,"getProcessName")
' Terminates the given process
Global killProcess:Int(pid:Int)"Win32" = GetProcAddress(DllHandle,"killProcess")

' Lists all running processes and returns an integer array holding the pid's 
Global enumProcesses:Int[]()"Win32" = GetProcAddress(DllHandle,"enumProcesses")
' Reads the memory at address "addr" of the given pid. "bytesToRead" determines how many byte to read.
Global readProcessMemory:Byte[](pid:Int, addr:Int, bytesToRead:Int)"Win32" = GetProcAddress(DllHandle,"readProcessMemory")
' Writes the memory at address "addr" of the given pid. "bytesToWrite" is the byte array with the data to write.
Global writeProcessMemory:Int(pid:Int, addr:Int, bytesToWrite:Byte[])"Win32" = GetProcAddress(DllHandle,"writeProcessMemory")











