Disable Windows/Home capacitive button programmatically C++ - c++

Surface Pro 3/4 and other Tablets have a physical Windows/Home button. Microsoft provides an app called "surface" which the user can download and use. It has a Windows button "off/On" setting to avoid accidental use of the button.
From this it would appear to me that it is possible to turn on/off that button programmatically. I do not see a Windows call to do it.
Anyone have an experience here in how to sniff what it is they're doing or outright know how to programmatically disable it?
Thanks in advance.

Related

Minimize, Maximize button disappear without any reason

It's a dialog based MFC application. I didn't intentionally add any code about the Minimize, Maximize and Restore button. It can show those button at the first. But it just disappear after long time running. Or maybe sleep of the computer causes this?
I have no idea about this, do you have any clue?
Edited:
Thanks #xMRi's remind, I checked its style, seems still to be right.
Listed below few possible reason & resolution may impact you application look. More specifically, your device manager plays important role in application appearance. I would say its environment or certain unnecessary application(Virus)installation issue rather than your MFC application issue.
Full Fix: Minimize, Maximize and Close Buttons Disappear
At least I know a way to restore the disappared system buttons.
ModifyStyle(0, WS_MINIMIZEBOX);
GetSystemMenu(FALSE)->InsertMenu(-1, MF_BYPOSITION, SC_MINIMIZE, _T("Minimize"));
Press F11 for Windows 10, or right-click on the application which you can't see windows button then choose view finally uncheck the full screen

Taskbar extension (like contacts)

In Windows 10, you can activate different buttons (e.g. task view button, windows ink workspace button, contacts button) by opening the context menu of the taskbar.
This is something different than the classic tray icons, and similar to deskbands (which has been deprecated?).
An example of the contacts button:
How can one achieve this? Is there a API for this? Are there documents available?
I think that you might be interested in Shell Extensions/ Taskbar Extensions - Deskbands, please refer to following web-sides for more informations:
https://learn.microsoft.com/en-us/windows/desktop/shell/taskbar-extensions#deskbands
https://msdn.microsoft.com/en-us/library/windows/desktop/ff468984(v=vs.85).aspx
How to write a shell extension in C++?
https://msdn.microsoft.com/en-us/magazine/dd942846.aspx
Perhaps the Taskbar API of Windows should be helpful in your case. Please note that the explorer.exe would be responsible for loading your extension, so that writing it in C# might have some limitations due to different CLR runtimes loaded.
It's commonly called a tray icon or NotifyIcon.
The official class is still in Windows Forms, if you want to be more modern have a look here on what your options are in WPF.

Override Close Box on Windows 10 Universal Apps UWP

I'm trying to prevent the app from being closed by clicking the Close box on the App Window.
For example, having a text editor with unsaved changes, upon pressing Close Box, I would first display, "Do you want to save changes before exiting?"
How can I detect app wanting to close and prevent that from happening?
I'm using C++, and this needs to be for Windows 10 Universal Apps UWP.
I already know how to do this for Win32.
The comments are correct. There is currently no way for a regular Store app to do this.
However, with the Creators Update (and corresponding SDK) we have included a preview API that you can now check out for this functionality:
The Windows.UI.Core.Preview.SystemNavigationManagerPreview class provides a CloseRequested event that an app can mark as handled. For the event to work the app will need to declare the restricted 'confirmAppClose' capability per:
https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
Please let us know your feedback.
Thanks,
Stefan Wick - Windows Developer Platform

How can I close an application using my program?

I am trying to disable Norton auto protect. I don't actually want to close the program. If you click on the Norton icon it gives you the option to disable it.
I would like to write a program that clicks the button for me. I am just not sure how to go about this. I am using C++ and I have Visual Studio and Windows XP.
Do you want to close an application or disable an application (like disable java update etc)? If you are talking about closing an application using your program, you can use "TerminateProcess()".
If you are talking about disabling application, share with us particular use-case exactly what do you want to achieve?

How to bring up the on screen keyboard using C++ in Windows 7 tablet devices?

I am developing an application for Windows 7 devices and I'm using an embedded web browser (webkit). Normally touching an edit control on a tablet device causes a little keyboard icon to appear. However, since my edit control is in the browser, it's not a real window with an hwnd and Window's doesn't bring up the icon you can click on to bring up the on screen keyboard.
Is there an API I can use to cause the little keyboard icon to appear as it normally would when focus goes to an edit control?
I tried searching MSDN, no success.
I looked at the Windows keyboard API. No dice.
I tried running OSK.exe. This could bring up multiple instances of the keyboard and it's just sloppy. I want to get the same effect a user would get when tapping a windows edit control so the UI is consistent.
There must be an API that can bring up that on screen keyboard.
Thanks.
David
Not sure if you have this answered already. I have been looking at doing a similar thing although it is a part of a larger application and the keyboard is rarely used (but nevertheless had to be supported). I assigned a shortcut key (right click Win 7 on screen keyboard application and choose Properties. In the shortcut tab, assign any shortcut you'd like). When I touch a SurfaceTextEdit control, I emulate the shortcut key from my C++ code using SendInput(). I know this is a hack, but it worked well for me because I rarely used the onscreen keyboard in my application.