c# How to programmatically disable Windows 8 specific features - c#

This question is asked alot, but I couldnt find working method / way to do it - except for a third party application.
I am pretty sure, or atleast I am being very hopeful that solution for this problem does exist.
As the title says, I want to disable window 8 gestures just like every third app is doing (SkipMetroSuite, ClassicShellMenu or w/e).
I need it to be built in in my app because I cant install anything on the compter my app is dedicated to but my app itself...
Is there a way to do it in C#?
EDIT:
I personally asked the developer of Classic Shell Menu how his programs works, here is the answer:
The principle is to inject a message hook in the thread of window with
class “ApplicationManager_DesktopShellWindow”, then listen for mouse
messages sent to windows with class “EdgeUiInputWndClass”, and hide
those windows. When my program exists it reshows all windows that it
has hidden.
He also mentioned I can find the solution here:
Classic Shell src
But there's one problem, the solution is in c++ and I have no Idea how to port it to c# so I would appreciate your help.
The solution is in ClassicStartMenuDLL.cpp which is in ClassicStartMenuDLL Solution.

The first step to what you want to do is to disable Metro mode (the start screen tiles).
You can achieve this via a registry edit, which you can do programmatically.
The entry of interest is the following:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RPEnabled
You need to set this to 0
Next, you want to disable the 'hot corners'. This is also a registry edit which can be done programmatically.
The entry of interest is the following:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ImmersiveShell
Create a new key called EdgeUI, and under thay key create the following DWORD entries:
DisableTLcorner
DisableTRcorner (Windows 8.1+)
DisableCharmsHint
Set both values to 1
Since these are both HKCU settings (i.e. current user), then a simple log-off is all that is required for them to take effect.
Alternatively you can kill the explorer process, though it is not recommended.
If it is not working for you, try to test it with a ready-made registry file first, since you might be doing something wrong -> Disable Charms & Switcher

Related

Detecting raised-event at OS-level (OS Appearance)

I have what seems to be a common problem. I am running Windows 7 Home Premium on one of the most awesomest computers (when it was bought last year) and certain visual effects just automatically turn themselves off.
My average user experience rating is high, so it doesn't explain why this happens. The only feature that ever gets turned off is the 'Show window contents while dragging' option. And it really annoys me.
There are currently no working solutions to this problem online. Other than to "there must be a conflict with another app installed on your machine."
And yes, I do know what app is causing this conflict. It's my bloody Internet Provider's software - you know... that app that you absolutely MUST have open at all times when you're connected to the net.
So, I had a thought. What if I could subscribe to an event so that my app that runs in the background will detect when this 'show window contents while dragging' option is turned off - and then my app will simply turn it back on again.
When I do this manually, it seems to stay in effect for about an hour or two, then it gets switched off again.
Is it possible to handle these types of events, and re-start certain visual effect features? If so, are there any resources on this?
I have not been able to find anything on this sibject yet.
Yes the WM_SETTINGSCHANGE message is sent to all windows when a system setting is changed. Then you can call SystemParametersInfo with SPI_GETDRAGFULLWINDOWS to determine if the "Show window contents while dragging" is disabled and use SPI_SETDRAGFULLWINDOWS to enable it.
So all that you will need to do is create an application with a form (that can even stay hidden) and override the forms WndProc and handle the WM_SETTINGSCHANGE message and call SystemParametersInfo using p/Invoke. The p/Invoke definition for SystemParamtersInfo is available at pinvoke.net
Altough what may be easier is change security on the HKCU\Control Panel\Desktop\DragFullWindows registry value so that it can't be changed.

Is there a way to set the compatibility mode in Win7 programmatically in C#

I am working on a program. In testing it on Win7(32-bit, don't know if it will be the same in 64-bit) I found a problem.
Now my problem is that some of the functionality does not work(like the right click doesn't show options or the program takes long to react). If however I set up a the compatibility mode it works fine. I mainly see this problem in Microstation, but it does appear in other places as well.
My question is as follows, is there a way to set these settings(like the check boxes) programmatically from C# ?
This might be necessary in cases where we do not do the installation of the program, to insure that it works on every pc it is installed on. Let us assume that during the installation the program has admin rights. (would it be needed to do this??)
this has nothing to do with Internet Explorer. i wanted to add a picture, but i dont have enough rep yet
There is no way to change this while the application is running, you have two choices to handle this issue:
Modify the installer to create shortcuts that have the compatibility mode flag set to whatever you need
You can manually manipulate the registry to force an executable to use compatibility mode, your application will require admin rights todo so + will need to restart afterwards
Here it's explained how todo it manually, you simply have to do it programatically:
http://kb.winzip.com/kb/entry/139/
In general I discourage you from doing either, fix your bugs instead.

Running just an app on windows 7

I have to run my C# application that I wrote it recently on several computers with window 7 operating system. Here is a big challenge with it, Application must run on startup and user must not be able to work with anything else such as windows hotkeys, other applications, some directories and etc.
Considering I don’t want to kill any process or service as less as possible, Please give me the best solution.
Thanks and waiting
Maybe A little more information will help
did you see Devices like ATMs or Medical devices that window is running on? Those devices don't allow user to manipulate with desktop or anywhere else, I want their solution. . . my Application Will run as a device handler(A Medical Device in Operating room).
You probably shouldn't write such an application in the first place (nagware?).
Anyway. I think what you are looking for is actually "kiosk" software. Here is blog entry that describes how to lock down the computer to effectively run in "kiosk mode".
Note however, that not every application can (or should) be used in that mode. Either because it has loopholes that still allow you to do thing (for example the file open/save dialog still allows you to create directories or navigate the file system), or because they were simply not designed with that goal in mind.
This sounds actually like a (very) bad idea to me...
You could probably hook every Keyboard event so you disable OS shortcut (Windows + D, Windows + E...). See here.
Also hide the Windows taskbar.
Make sure your application starts with Windows.
This sounds a bit hacky to me...
A program with the properties you mention is called a (very restrictive flavour of) shell. So you need to register your program as a shell (instead of explorer.exe) for the poor, poor user you want to restrict.
You might look into using a local group policy to enforce this restriction. Check this out.

c# How to detect if an external application has popped up a window?

I keep getting multiple verification prompt from a 3rd party application where on many instances I have to select the prompt window, type my password and click on Ok. I thought of writing a simple application in WHITE framework which can capture the window, enter my password and deliver a click automatically.
I need to detect whenever a new window has popped up in Windows environment. I don't want to use either a timer or a loop. Can I get an event when ever a new window appears (registers) ?
-- Regards
Akshay Mishra
Outside of managed code you could use global WindowHooks, however this involves injecting a DLL into another process space.
This is not easily done with managed DLLs (read: assemblies). (It can be done, see here)
I wrote an article on CodeProject a while ago on how to create a sort of managed global hook for WM_CREATE and WM_DESTROY messages.
It includes full source code and it probably has what you need. Your application will need administrator privileges for this!

Multi-project solution & cross-application data handling

Time for another "what am I overlooking" question! Thanks in advance for your guidance, and as ever, you guys rock! :)
.NET 2010 Winforms, but I only have the Express version. I have 05 Pro, but am trying to transition to 2010. If I need to upgrade... well, maybe I'll stick with 05, since this is just for my own amusement.
I want to make a multi-application suite for a project I've got in mind. The project has several components that should interact together, but still be robust and stand-alone.
The components include:
1) A Notification Area utility (I/E System Tray) - I anticipate using this as a quick-launch, data-passing medium, and other minor things. I'd like to keep it as small as possible. Double-click to launch main menu, right-click to launch another app.
2) The Main Menu. This is what would start if you run the program normally, and essentially organizes the other apps.
3-6) These other apps each do some things, but are fairly self-contained.
.
.
Question 1: What is a multi-app or multi-project solution called? I think I'm missing a buzz-word here, because my search-fu isn't getting any results.
For the most part, I'm looking for some pointers, more precise vocabulary, and some suggestions on what existing features can handle these sorts of things.
Question 2: How can I make each of these apps/projects able to launch independently? I don't want to go through the Main Menu each time; I want the ability to start the app from Program Files directly.
Despite that requirement, I also need to check if the Notification Utility is running, and start it if it isn't. The Utility should be running any time any other app is running, and closing it would close all the other apps.
Also, the Notification (and Main Menu) apps need to be able to start the other apps.
Question 3: How can I pass data between the windows?
The concept in my head is to have Window A send a packet to the Utility, which would then pass it to Window B. Window B also needs to send a confirmation packet.
Question 4: How can I set up one of the apps (the Notification Utility)
Question 1 - "Solutions" typically contain one or more projects.

Categories

Resources