First post, by videogamer555
I wrote this program in VB6. It uses Windows API to read raw HID (human interface device) data from the real USB mouse attached to your computer. By doing so, instead of getting the current cursor's position on the screen, it gets the x/y movement values sent from the actual mouse. And these are what is needed to generate a proper serial mouse data packet. From there it uses the Winsock ActiveX control to send the packet.
When the program first starts, it attempts to connect to IP address 127.0.0.1 and port 1234. After about one second, if no server program is listening on that port, my program closes. To make my program work with DosBox, use notepad and load your DosBox config file, and in the serial port configuration set serial port 1 to:
Then save the config file. Then start DosBox. After DosBox is running, start my serial mouse emulator. Then run a program that you know absolutely requires a serial mouse (such as Windows 1.0, and don't use the modded version that is actually using the Windows 2.0 PS2 mouse driver, or maybe play some really old game that requires a serial mouse). It should work perfectly, just as if you were using a real serial mouse. If you don't want to see both your real mouse cursor and the one in DosBox both at the same time, you can make DosBox grab your real cursor, which makes it disappear. To do this, press Ctrl+F10 in DosBox. Press Ctrl+F10 again to make DosBox release control of your real cursor.
Here's something to note. As my serial mouse emulator uses the Winsock ActiveX control for the TCP connection, you will need to have a copy of the file MSWINSCK.OCX in your system folder (Windows\System32 on 32bit Windows, or Windows\SysWOW64 on 64bit Windows). This OCX file comes with VB6 when you install it, and also I think in some older versions of Windows, but not in anything newer than Windows XP. I could have created an installer package for my program that would have installed this dependency, but since you may already have the file, I felt it was easier to post it as a separate download here. If you don't already have MSWINSCK.OCX installed on your computer, you will need to copy it to the correct system folder (as mentioned above), and then you will need to run the following 2 commands from a command prompt with administrator privilege:
cd c:\windows\system32 (or if in 64bit Windows, use cd c:\windows\syswow64)
That will install the Winsock ActiveX control on your system. Then the serial mouse emulator program should run fine.
Also note that sometimes my program locks up when it first starts, at least on my PC. I traced this back to my copy of Norton Antivirus somehow interfering with its operation. It's not because it detects it as a virus (it doesn't, it finds it completely clean/uninfected), but rather somehow its scanning process (which involves injecting virus scanner threads into the running program, in order to monitor the program for suspicious behavior) is itself sometimes causing interference in the program's normal execution. I found that one specific feature of Norton Antivirus is responsible for this problem. It's called "SONAR Protection". If you disable just that one Norton feature (and leave all of the other antivirus/security features running), then my serial mouse emulator will always run without a problem. I would highly recommend permanently disabling that one feature as it has caused problems in other programs too, and it seems to do so more in ones written in VB6.
Attached to this message are 2 files:
Serial Mouse Emulator.exe
MSWINSCK.zip (I put the OCX file into the ZIP file, because the attachment system here didn't let me directly attach the OCX file)