Disable Gestures through registry - windows

On windows, I want to disabe gestures through Settings->touchpad->three-finger/four-finger gestures works immediately.
I noticed that when setting changed, registry value changed on the same time:
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\ThreeFingerSlideEnabled
But when I try to modify the registry value by regedit.exe, it's not working without explorer.exe restart.
I try to send message WM_SETTINGCHANGE after modify registry, not work either.
PDWORD_PTR lpdwResult = 0;
SendMessageTimeoutA(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, (LPARAM)"Environment", SMTO_NORMAL, 2000, lpdwResult);
Is there any way to disable gestures without restarting the explorer.?

Related

How can I refresh the Taskbar programatically in Windows 10 and higher?

Right off the bat, please don't judge too harshly, I'm still relatively new to this forum and not too practiced at formulating my question yet :)
Background:
Because I have to install Windows and do it's configuration on new computers very often, I found some settings are always the same but anyway important (like showing filetyype endings, disable cortana and news & interests, pin Word/Excel to taskbar, etc.)
Problem:
My problem is about the task-view button - I set it hidden in registry (but let the chance to reactivate it anytime). Sure - you can make a change to the taskbar settings manually, but per program this won't work. Because of such changes won't adapt until reboot or restart of "explorer.exe" under normal circumstances:
How can I disable the taskview button (or refresh the taskbar in general) programmatically without killing any process?
And no - other similar questions don't help, since they're related to either the systray or old OS' it's solution are not longer working.
My Environment:
Windows 10 32/64-Bit 21H1
I'm happy with pretty much any solution, no matter the program language.
Thanks in advance for your help.
DWORD data = 0;
SHSetValueA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", "ShowTaskViewButton", REG_DWORD, &data, 4);
SendNotifyMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) TEXT("TraySettings"));

How to power off or black screen monitor on Windows

I am dealing with black screening like Teamviewer.
I want to power off monitor or make a completely black.
This method https://stackoverflow.com/a/713511/2469925 is useless for me. Because when mouse or keyboard in use monitor automatically opens back.
I found IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE but I guess it looks deprecated after XP. I think there is no usage currently.
Also I tried Setting brightness on Windows 10 using C++ WinAPI this method with Teamviewer Monitor driver.(Teamviewer driver allow me to reach device)
I could get handle with Createfile but
DeviceIoControl(h, IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS,
(DISPLAY_BRIGHTNESS*)&_displayBrightness, nOutBufferSize, NULL, 0, &ret,
NULL)
always return 1 which is error/invalid function.
When I check my win10 settings also I could not find brightness settings. There is no such menu.
Any help is will be appreciated.
How can I do this with driver or driverless.

Cannot send keys to screensaver in windows 10

How can I send keys to a screensaver in Windows 10. I have tried to install my own screensaver and have disabled logon screen so I only need a keypress to show my desktop. I Guess a part of the problem is use of different desktop, but even With the code shown in the link bellow I cannot figure out how to send a key Message to the screensaver. Any suggestions?
http://www.delphipraxis.net/1059352-post7.html
This is an XY Problem. You are asking how to send keys to a screensaver to deactivate it, so it does not interfere with simulated mouse clicks you want to send to another app. That is the wrong question to ask. You should be asking how to disable the screensaver from running in the first place while your app is busy interacting with the other app.
You say you have disabled the screensaver password. In which case, you can have your app handle the WM_SYSCOMMAND message. If the message's wParam value has the SC_SCREENSAVE flag enabled, discard the message without passing it to the default message handler. Then the screensaver will not run. This only works if your app is in the foreground at the time (SC_SCREENSAVE is only sent to the foreground window), and only if the screensaver password is disabled, though:
If password protection is enabled by policy, the screen saver is started regardless of what an application does with the SC_SCREENSAVE notification—even if fails to pass it to DefWindowProc.
If you need to handle the message while your app is not in the foreground, you can use a global message hook via SetWindowsHookEx() to change WM_SYSCOMMAND/SC_SCREENSAVE messages into WM_NULL when being sent to any HWND in the system.
An alternative approach (only if the screensaver is not already running) is to use SystemParametersInfo() to set SPI_SETSCREENSAVEACTIVE to TRUE to make the system think that a screensaver is already running so it wont start another one (you can use SPI_GETSCREENSAVERRUNNING to check if one is running). This is an old-school way to avoid a screensaver from starting, however on Vista+ onwards with added security policies and such, this probably does not work as well as it once did.
Another alternative is to disable the screensaver in the Registry while your app is busy*. Set the HKEY_CURRENT_USER\ControlPanel\Desktop\ScreenSaveActive value to 0 (just make sure to restore it before your app exits).
*This technique is even used by Windows itself (Vista+) if the user dismisses the screensaver immediately after it starts. Windows assumes the user is annoyed with the screensaver, so the screensaver gets disabled, and is then re-enabled a few minutes later.
I had given up on this but i stumbled over the following code that Works
function KillScreenSaverFunc(Handle: hwnd; Temp: LongInt): Boolean; stdcall;
begin
PostMessage(Handle, WM_CLOSE, 0, 0);
KillScreenSaverFunc := TRUE;
end;
procedure KillScreenSaver;
var
myHDESK:hdesk;
begin
myhdesk := OpenDesktop(Pchar('Screen-saver'), 0, FALSE,
DESKTOP_READOBJECTS or DESKTOP_WRITEOBJECTS);
if myhdesk<>0 then begin
EnumDesktopWindows(myhdesk, #KillScreenSaverFunc, 0);
CloseDesktop(myhdesk);
end;
end;

Windows 7 touch screen - disabling multi-touch gesture not working

I have a touch screen computer with Windows 7 and I would like to disable the multi-touch gesture :
But even if I disable it and apply the changes, when I reopen the window, the option is enabled again...
Any idea where I can disable it for good ? (maybe in the registry...)
Up: still have the problem.
How to disable "multi-touch gestures and inking"
Run \Windows\System32\regedt32 as Administrator
Navigate to HKEY_USERS
Find entry that starts with S-1-5-21-xxxxxxxx
Note there might be a few GUIDS that starts with S-1-5-21.
You need the one that you can drill to
S-1-5-21xx\Software\Microsoft\Wisp
Under Wisp key there should be keys like Pen, Touch,
to indicate you are in the right location
Under Wisp key add additional key MultiTouch
Go inside MultiTouch key and create DWORD
MultiTouchEnabled set to 0
Reboot

Problem hosting WebBrowser control in an ATL app

I have a legacy atl app that hosts a webbrowser control in an ATL window. I create an instance of the client to host the browser using the following sequence
CComPtr<IOleObject> spOleObject;
HRESULT hr = CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, ID_IOleObject,(void**)&spOleObject);
spOleObject->SetClientSite(this);
GetClientRect(&rcClient);
hr = spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, &msg, this, 0, m_hWnd, &rcClient);
hr = AtlAdvise(m_spWebBrowser, GetUnknown(), DIID_DWebBrowserEvents2, &m_dwCookie);
CComVariant navvar(navurl);
m_spWebBrowser->Navigate2(&navvar, NULL, NULL, NULL, NULL);
This sequence works fine to create the initial browse window. The call to navigate2 works and if I look at the window via spy++ I have Shell Embedding -> Shell DocObject View -> Internet Explorer_Server. When a popup occurs (detected through NewWindow3) I launch a new window and execute the same code sequence for the new window. In the popup window the navigate2 doesnt work, and when I look at this new window in spy++ I just have Shell Embedding. I get the same problem even if I instantiate the popup window on startup, so its not related to NewWindow3 at all - it seems the second instance of the web control isnt instantiating even though all the calls return S_OK.
This sequence worked fine under IE7 but now I am using IE8 and the popup window isnt working. There is clearly something I am missing but I cant guess what it may be. Any suggestions would be incredibly helpful.
Turns out that when I created the main window I called
m_spInPlaceObject = m_spWebBrowser;
_ASSERT(m_spInPlaceObject);
if (m_spInPlaceObject)
m_spInPlaceObject->SetObjectRects(&rcClient, &rcClient);
But I didnt have this call in the popup initialization. Once I added this to the popup initialization it worked fine.
For whatever reason it worked on IE7 but not on IE8.
Slack coding on my part. Hosting the IE control in an ATL app is still as neat as ever!

Resources