API Calls
BlitzMax Forums/BlitzMax Programming/API Calls
| ||
Could anyone please tell me how to do API calls from user32 and kernel32? |
| ||
Like thisExtern "Win32" Function GetCurrentProcess:Int() Function ReadProcessMemory:Int(hProcess:Int,lpBaseAddress:Byte Ptr,lpBuffer:Byte Ptr,nSize:Int,lpNumberOfBytesRead:Byte Ptr) Function WriteProcessMemory:Int(hProcess:Int,lpBaseAddress:Byte Ptr,lpBuffer:Byte Ptr,nSize:Int,lpNumberOfBytesWritten:Byte Ptr) EndExtern |
| ||
Does using "Win32" as the head open user32.dll,kernel32.dll, and gdi32.dll? |
| ||
it will link it against the own kernel32.a etc in the lib folder. with 1.26+ and mingw 5.1 this should cover more or less all XP API capabilities, yes. |
| ||
"Win32" is the stdcall calling convention, your source code gets linked with user32 and kernel32 anyway. If you want to link an import library in the lib folder use "import -l" followed by the name. If you rather load a dll at run-time use the GetProcAddress API. |