holoc Posted May 6, 2010 Share Posted May 6, 2010 WinIo - This library allows direct I/O port and physical memory access under Windows 9x/NT/2000 and XP. Version 2.0 provides faster I/O port access, better memory mapping support and can be used from non-administrative accounts under Windows NT/2000 and XP. http://www.internals.com/utilities/winio.zip The documentation is included within the archive. Here is the code: If WinActivate("Untitled - Notepad") = 0 Then MsgBox(0,"Error", "Start the Notepad first.") Exit; EndIf Sleep(1000) DllOpen("WinIo.dll") DllCall("WinIo.dll", "bool", "InitializeWinIo") Sleep(100) ; send to port 0x64 Command Byte 0xD2 (Write keyboard buffer) - Parameter written to input buffer as if received from keyboard. DllCall("WinIo.dll", "bool", "SetPortVal", "word", 0x64, "dword", 0xD2, "byte", 1) Sleep(100) ; send to port 0x60 Byte 0x04 (press key 3) DllCall("WinIo.dll", "bool", "SetPortVal", "word", 0x60, "dword", 0x04, "byte", 1) Sleep(100) ; send to port 0x64 Command Byte 0xD2 (Write keyboard buffer) - Parameter written to input buffer as if received from keyboard. DllCall("WinIo.dll", "bool", "SetPortVal", "word", 0x64, "dword", 0xD2, "byte", 1) Sleep(100) ; send to port 0x60 Byte 0x84 (release key 3) DllCall("WinIo.dll", "bool", "SetPortVal", "word", 0x60, "dword", 0x84, "byte", 1) DllCall("WinIo.dll", "none", "ShutdownWinIo") DllClose("WinIo.dll") I have NO ERRORS, but it doesn't work. It does not send anything(checked this). What is the right syntax? SetPortVal This function writes a BYTE/WORD/DWORD value to an I/O port. bool _stdcall SetPortVal( WORD wPortAddr, DWORD dwPortVal, BYTE bSize ); Parameters wPortAddr [in] I/O port address dwPortVal [in] Value to be written to the port bSize [in] Number of bytes to write. Can be 1 (BYTE), 2 (WORD) or 4 (DWORD). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now