I want to have some code run when the user tells Windows to show the desktop, such as when the user presses Win+D. I am having issues finding what that event is. I tried using spy++, but couldn't find what I was looking for, and the documentation for things like this seem poor or nonexistent.
Specifically what I want to do is avoid hiding the window because I'm making a desktop overlay program, and having this as the desktop is precisely the purpose of the program. If there is an alternative to handling the Windows event to accomplish this, I would be fine with that. I saw This answer, but unfortunately it doesn't work on Windows 10, which I need to support, along with 7 and 8.
Related
On Win11, when I use Alt-Tab to cycle through the windows on my machine, I can see live miniature versions of the active windows, including video on YouTube. Does anyone know a way to do this in c#.
Ultimately, I want to have a page that shows a few live miniature windows that the user can click on one to go to that program. It is important to be able to see changes, e.g. flashing alerts, on the miniatures, so ideally the update rate for each should be <200ms
I've tried searching online for solutions, but I've not found a way to phrase the problem such that I get any clues where to even start
In Windows Control Panel there is a tool that allows us to control system sounds. Visual Studio supports this by providing several "Program Events" which allow you to associate a specific sound with them.
I have a console app that I would like to support these sounds configured from Control Panel. They are for several long running events in my app and usually I leave it running in the background, but I have to check that a certain operation was done before I can continue using it.
I know about Console.Beep(), but it doesn't suit my needs. Any suggestions on what to research? I tried looking for "C# program events" (like they are labeled in the Sound Control Panel), but obviously that gives me results about the C# event keyword.
I am interested to know how can I do the same thing that the apllication listed below does:
Start Menu Calculator
I want to know how can I create an custom tab in Start Menu Search and then handle it with my WPF application. It should only be enabled until my application is running.( Just like what The calculator does )
I read something about windows API Code Pack and I downloaded it but I don't know how can I use it. I searched through it but I didn't find anything.( If you know how I could do this using with Windows API Code Pack, please write an example that explains how to do it in C#)
The main exe "Start Menu Calculator.exe" installs a windows hook (using SetWindowsHookEx) into explorer.exe. The hook is implemented as usual in SBLib.dll which is then injected into Windows Explorer's memory space.
This hook searches for window handles belonging to the search box. See a discussion around this here:
How do I get a "handle" on the Windows Search textbox? and probably sub classes the search box windows (if you kill the "Start Menu Calculator.exe" process abruptly, it crashes Windows Explorer too... which kinda confirms this)
It then reacts to key presses, and I suppose it butchers up the result window. In the hierarchies of Windows, I think it's a Window named "Desktop Search Open View", you can get to it with SPY++ under "Start Menu", aside the windows mentioned in the msdn forum above.
So, no nice API behind this nice application. Massive hacks instead :-)
I think however, some level of integration is possible, using documented behavior, with the search box. I have not dug further, but there is the notion of federated search in Windows (Windows 7 Federated Search). I don't see if this would be capable of reacting instantaneously to what the user types in though...
As a side note, if you're also looking for a way to run javascript code from C#, there is a question here on SO that says it all: parse and execute JS by C#
When making Start Menu Calculator I initially tried to use federated search and Managed (.NET) code however you can't integrate into the start menu, only the shell search (for web service based search which lets you return custom results based on a search string). The problem is that the federated search is structured such that all the search data is pre-indexed so for the calculator to work I would have had to pre index every possible calculation! The reason it all works this way is to make sure that clicking the start menu is always fast and responsive (you don't want a web service call everytime you press start in the shell).
I ended up hiring someone to write a native windows app that places a IE control into the Start menu search area and passes the searched text in with the source. All the visual stuff is just css made to look like the start menu rendering and the calculations handled in javascript.
So yes, a bit of a hack but it seems to work and I havent had/heard of any crashing issues so far.
I need to write a program that forces Google Chrome to be in the front and disable all other actions like opening another program etc... I just need to have Google Chrome in front of the screen and that's all. I can't allow other programs to pop up.
Any ideas how it can be done?
Thank you!
Im pretty sure as far as you can get is a popup window that has no scrollbar or top bar, and can't be resized, but JS wont let you manipulate stuff outside the current window, just like you cant auto-click links inside an iframe
I highly doubt this is possible in Windows, and if it is it won't be ethical if used on home PCs. Will this be a kiosk style app?
You can control what appears in the browser to some extent, such as scrollbar-less windows but much more than that is impossible.
Definitely not ethical at all but applications such as Fortress 101 can do this. I have done similar things in the past using C and the Win32 API. I won't write the code for you but I basically did the following:
Find the desktop and hide it
Find and hide the taskbar
Find and destroy the start button
Capture special keypresses and prevent them from working as expected
You would also need to poll a process list because even doing all of that doesn't prevent the user from downloading a file and executing it. Thus if you found a new application in the process list, you could destroy it.
You could do this using user32.dll with C# but such an application would better be left to commercial software packages.
I am developing a security and kiosk library in my framework. The problem here is I have the proper methods and routines to disable various features of the Windows Shell. The main feature I am discussing here is the Windows Taskbar.
I have properly disabled, and hid the Windows Taskbar. The problem is that the WorkingArea of the Window's desktop is not updated by ShowWindow/EnableWindow calls to the Taskbar, and still leaves the reserved space for the Taskbar on the desktop.
After reading almost all the topics regarding this, I am dissappointed. I am not looking to simply make my program "Full Screen", "Top Most", those are not acceptable answers. I am actually looking to either unregister the Taskbar as an AppBar, or update the WorkingArea. Any other solution is not what I am looking for as they are just "workarounds" and not actually resolutions.
Any links, whitepapers, or code samples/guidance is appreciated.
You are going to have to be more flexible if you want a solution. The only odds you'll have for a 'perfect' solution is SHAppBarMessage with ABM_REMOVE. The odds aren't good, especially on Win7. I don't want to try this myself, I like my taskbar :)