News Archives 2024 Q1
2024-03-21
•
HasHardware.exe had another update (1.03):
though elevated privileges are still preferred, with the new optional command line switches
/C
and
/H
you can use the program without elevated privileges.
You may get less details in verbose mode without elevated privileges.
• Oops (twice), two more updates for
HasHardware.exe (1.05):
- in "YesNo mode" (
/Y
switch) the program would return incorrect exit codes => fixed
- without elevated privileges, keyboard and mice details would always be displayed, even in quiet mode (
/Q
) => fixed
- without elevated privileges, the specified mouse or keyboard connector type would be ignored, and all keyboards and mice would be returned, but the result suggested it wasn't;
the mouse connector type will now be correctly displayed and the query will list only mice with the specified connector type;
unfortunately, for the keyboard there is no such fix, the query will return all keyboards, but the result no longer suggests it returns only the keyboards with the specified connector type
2024-03-17
•
HasHardware.exe has been updated: in verbose mode, it will display a
lot more monitor details.
2024-03-15
2024-03-11
• After finding a reliable WMI query to find the actual number of connected mice, I updated
HasMouse.exe once more (4.00).
This latest update can distinguish between USB, RS-232 (serial) and PS/2 mice.
Unfortunately, it
does require elevated privileges, if that is not an option, use version 3.00 which is still included in the ZIP file.
• Now that mice can be counted reliably using WMI, a
batch version using
WMIC was the obvious next "project".
2024-03-09
•
HasMonitor.exe is the lates addition to the
HasHardware
family.
As its name suggests, it checks the
actual number of monitors connected at this very moment.
I tried using several Win32 API functions to achieve this, but in the end I found a really simple way to use WMI instead:
Win32_DesktopMonitor
's
MonitorType
property value will equal
Default Monitor
and its
MonitorManufacture
property will be empty for disconnected monitors.
Be warned that
MonitorType
may equal
Default Monitor
for a connected monitor, in that case
HasMonitor.exe's optional
/D
switch can be used to correct the number.
The best way to avoid this is by installing the manufacturer's driver for the monitor.
2024-03-06
• Since Pavel Pachobut's
C# wrapper for GetRawInputDeviceList can be used to
count the actual number of mice, instead of having to guess by counting the total number of mouse buttons, I used it to update
HasMouse.exe once more.
Unlike
HasKeyboard.exe, the updated
HasMouse.exe cannot distinguish between USB and non-USB mice.
The program's return code now equals the actual number of mice detected, or -1 for (command line) errors.
The downloadable ZIP file contains versions 1.* and 2.* of HasMouse as well.
While at it, I also wrote
HasHID.exe, which combines the functionality of
HasKeyboard.exe and
HasMouse.exe into a single executable.
Thanks Pavel
2024-03-04
•
HasKeyboard.exe is a new batch tool, similar to
HasMouse.exe, but using the Win32 API's
RawInputDeviceEnumerator
to count the
actual number of keyboards available
at this very moment.
By default it counts all keyboards, but optional command line switches allow you to count either USB keyboards only, or non-USB keyboards only.
Unlike
WMI the result is not cached, and as far as I know this is the most reliable keyboard (and possibly mouse as well) detection available.
The code used is based on Pavel Pachobut's
C# wrapper for GetRawInputDeviceList on GitHub, I just added the
AllKeyboardsCount
and
OtherKeyboardsCount
properties to its
RawInputDeviceEnumerator
class.
Thanks Pavel
2024-02-29
•
HasMouse.exe had a minor update (1.01): if a mouse was detected, the result is shown in green instead of in red.
•
HasMouse.exe had another update (2.00): I found that, unlike my earlier assumptions,
.NET's System.Windows.Forms.SystemInformation does return the
actual number of mouse buttons, just like
GetSystemMetrics does.
So I replaced the P/Invoke of
GetSystemMetrics(43)
by
SystemInformation MouseButtons
.
During testing the response times of the latest update were more or less equal to those of the old version if a mouse was detected, and slightly faster if no mouse was found.
2024-02-27
2024-02-26
• Health issues have kept me occupied for over 6 weeks, and may continue doing so for the near future.
For now I spend less time at my computer than I used to do, so it may take much longer before I reply to your mails.
•
HasMouse.exe is a new batch tool, using
GetSystemMetrics to detect if there is a mouse available
at this very moment.
Unlike
WMI and SystemInformation, the result is not cached, and as far as I know this is the most reliable mouse detection available.
2024-01-02
• I just added some PHP code to show the page load time at the bottom of each page.
The code was submitted by
Ron on StackOverflow.com:
print( "page loaded in " . number_format( microtime( true ) - $_SERVER["REQUEST_TIME_FLOAT"], 4 ) . " seconds" );
Thanks Ron
•
PDF Form Test has been updated again, it now recognizes Adobe Reader, Acrobat Standard and Pro, eXPertPDF, Foxit PDF Reader, Nitro PDF Reader and PDF-XChange Editor.
Besides, when printing the form, some additional debugging info will be printed.
• After 21 years,
OpenAs.bat has been updated: it no longer requires a full path for the specified file.
The cost? It will open the file using its short 8.3 name.
2024-01-01
• I wish you a happy 2024, may it turn out to be your best year so far.
page last modified: 2024-04-15; loaded in 0.0029 seconds