Can I control the state of the Speaker Icon with Delphi code - windows

Is it possible to control (Enable/Disable) the Speaker Icon in Delphi Code.
Is there a registry entry for this?
Many Thanks...

While it might be possible to "hide" the icon by changing a undocumented registry value, the user can unhide it again in the tray icon options so this is not really a permanent solution.
If you insist on ignoring your users desire to mute their machine you can unmute the volume programmatically.
On Windows XP/2003 and older you will have to use the old mixer API. This API is not fun to deal with and you have to remember to unmute both the Wave and master volume lines. See this and this for inspiration.
Vista and later has a new COM based API that should be less painful to deal with. Create a instance of IMMDeviceEnumerator and enumerate the render endpoints (or use GetDefaultAudioEndpoint) and call IAudioEndpointVolume::SetMute on the device endpoint. This example should be pretty close, just translate it to Delphi. Volume can also be controlled per application so you might need to deal with that as well if your users are clever.
Larry Ostermans blog is also a great source for help and details about this new API.
Note: As a workaround for your unmuting, the user can simply set the volume really low to get rid of your sound. There is really no way for you to know if the sound is audible at a low volume level and setting it higher just because you can would be very evil and could really hurt somebody with headphones etc.

Related

Where is loading circle on Windows stored at?

I am wondering where is, for example, that circle dotted loading animation stored, which we see on startup. What if I wanted a twerking amogus instead? IS it even possible to change that?
I'm not really looking for downloadable tools, I'm interested in deep understanding myself (I'm studying computer architecture at uni), so if you have any answer, it would make me super happy.
I changed sounds already, but it's apparently not enough for me. Also, is it possible to change a picture loaded in BIOS on the startup?
Edit: I don't mean changing the cursor
The Ring progressive animation appears to be able to be configured from the registry e.g.:
https://www.thewindowsclub.com/how-to-enable-new-progressive-ring-boot-animation-in-windows-11
Open the Registry Editor.
Navigate to SYSTEM\ControlSet001\Control key
Create a new key under the Control folder.
Name it as BootControl.
Create a new key (DWORD (32-bit.)
Rename the new key as BootProgressAnimation.
Change its value to 1.
Restart your computer.
For changing the windows splash screen see e.g. here Is it impossible to change the splash screen at runtime in uwp?
The bios "splash" image is particular to your BIOS. BIOS is basically a set of functions that are lower level than the OS and very hardware specific. So it is provided by the motherboard manufacturer. Depending on your motherboard you would have to Google on how to change it, most modern BIOS offer some option. The steps normally would be
(good to do) update the BIOS firmware
enter bios: involves pressing a key combination before booting the os, possibly del, or f1,... rtfm, or google your model
go to option for selecting the splash screen and change it
It is possible that there is also an app from the manufacturer that can do that e.g. this is for asus: https://www.techwalla.com/articles/how-to-edit-an-asus-splash-screen

How to replace Windows 8 volume indicator overlay?

New to Windows 8 and 8.1 is a volume overlay that sits above all other windows, and displays for 3-5 seconds every time you press one of the special volume buttons present on many keyboards.
Please note that I am not talking about this:
But rather this:
Which appears in the top left corner of the monitor.
I would like an API or something that will disable the display of this indicator when volume buttons are pressed on the keyboard.
Does something like this exist? Programming language doesn't matter, as I can convert from whatever to whatever, but for reference I will be implementing this in C++
There is not a documented method for disabling the UI, and I'd expect that any technique for doing so would rely on potentially risky/unsupported APIs/techniques.
The UI is now provided by Microsoft to enable a standardized experience for volume control across all devices. Some applications like the Microsoft Music application expect the volume control to be present so that they appear together.
In Win 8.1, all Media handling support was moved to the SystemMediaTransportControls. An app has only a tiny bit of control over display: IsEnabled.
If possible, you might consider relying on the built in support -- as they're not likely to go away, and it's unlikely that you'll be able to control them in the manner you want.

Low level keyboard hook

I just bought a new keyboard, and I'm interested in tracking exactly how many keypresses/strokes I make during the entire life of the keyboard. (I would want to just record keyUp, as I don't care about repeats)
I've been googling around for the best way to do this, but I don't even know what approach to take, so I'm having trouble searching intelligently.
Also, the only language I've really worked with is C#. Haven't done anything with C/C++ or WinAPI
Is it difficult to modify the Win 7 drivers directly?
I do want to be able to record keystrokes from the moment the computer boots, but this may not be easily done.
I would prefer to use an existing driver or hook, as I really don't care to get into learning device drivers right now.
I've looked briefly at Ctrl2Cap, but I don't know how to modify something like that to suit my case.
Other questions I looked at,
Writing a keyboard device driver
Low level keyboard Hook not at UI thread
This one indicates writing a USB Filter driver may work, but I have no clue where to start on that.
Disabling the keyboard in windows c++?
It is not necessary to go the driver route, which is not for the faint of heart. You can use use a low level keyboard hook which will work fine from .NET.
I did a quick bing and found the following on codeplex
http://globalmousekeyhook.codeplex.com/
It should get you going
If you want to do that you need to use Kernel Level Keylogger. It's grabs the keystrokes before the operating system takes effects and this one 99% invisible for detection techniques. Then you can grab the Windows Log On screen typed things like password/username etc.
#ChrisTaylor's key logger not work for WinLog-on Screen I reckon. If you can install the keyboard driver filter before the system keyboard device driver take a action you can handle windows user login screen also. But In order to install this driver level key hook you need to have administrator privileges.
I found Unix and Windows Keyloggers from Github. Free to play with this https://www.adlice.com/kernelmode-rootkits-part-3-kernel-filters/ and have fun!
That, what you want is dangerous!
With the same code everyone can create keylogger*
But if you not a virus creator then I recommend you to search "hotkeying in C/C++" or something like that and hook keyboard with hotkeys!
I have written HotKey Maker in VB6 which can make hotkey from every button of keyboard.
But I really not interested in viruses :)
Good Luck !
*Virus which hooks your keyboard and send all what you wrote in keyboard to Virus owner

Detecting GUI state and generating user input programmatically in Windows Xp

I am looking for a lightweight solution that would allow me to detect which form/ dialog is open in an application, then emit some keystrokes / mouse moves and clicks. I do not have control over (nor the source-code for) the application.
I am familiar with MacroMaker, also testing products like SQA / Mercury offer similar functionality. The last time I had hands on exposure in this are is late 2004, I welcome any pointers to bring my knowledge up to date.
AutoIt is a scripting environment for Windows with a long history. It's quite easy to use and flexible to do things like detect the open window or dialog, change to another one, type something, etc. I would definitely recommend it.
In case anybody is curious, in the end I decided to use Microsoft UI Automation. Here is nice intro:
http://msdn.microsoft.com/en-us/magazine/cc163288.aspx

new Windows 7 systray - how to show information to users now

new Windows 7 hides systray icons by default.
what is the recommended way to show information to users now?
I need to have a small clickable icon visible to user so user can access my "tool" anytime. Should I use the gadget to show my GUI instead? Can it communicate with my Delphi app somehow?
Without more information it's a little difficult to provide a recommendation.
However, I would imagine that a sufficiently important tool, the user would simply keep minimized. They could then use Jumplists to access quick functionality.
For example, Live Messenger uses this setup on Win7.
If your users really like your icon/application they can always choose to not hide your application.
The only difference is that only the user can choose which icon is shown, instead of every application claiming it's "real estate".
In my opinion this is a good functionality and if I were you I wouldn't change the application, just provide a first run GUI which explains how to make your tray icon visible in windows 7.
The entire reason why change was made, was to stop programs like yours. If you need to show information, go ahead and do so. But the notification areas ("systray") is not where shortcuts go. For that, you've got the start menu, desktop and/or the quick launch bar (and please let the user decide).

Resources