Grouping of the results in AutoSuggestBox UWP - grouping

When using SearchBox in Windows 8.1, on SuggestionsRequested event there is ability to separate results if they can be grouped with the help of AppendSearchSeparator.
But I can't find something similar for grouping in AutoSuggestBox.
How can grouping of search(suggestion) results be implemented/applied in AutoSuggestBox for UWP ?

It is strange, in MSDN it says (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn301949.aspx)
SearchBox is no longer available for use as of Windows 10. Instead, use AutoSuggestBox.
So I tried to use a AutoSuggestBox in a UWP app, as it said here (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn919949.aspx), there should be a event: onsuggestionsrequested, but in XAML, I didn't find it either.
So, I tried to find a new event in which the SuggestionsRequested event can be used, but I failed.
Finally, I downloaded a sample code of a Windows 8.1 SerachBox here(https://code.msdn.microsoft.com/windowsapps/SearchBox-control-sample-0f64f94d), and ported it to a UWP app, the result is, the SearchBox can still be used in a UWP app.
Maybe there is a event of AutoSuggestBox for this, I just didn't find it. This is a good question I think.

Related

Windows 10 detect keyboard layout change

I'm trying to implement a service that would monitor language/layout changes. I switch between English and Russian languages. So far I've found this question and tried to implement and install both sinks suggested there.
However, there are problems. ITfActiveLanguageProfileNotifySink::OnActivated is not triggered at all; ITfLanguageProfileNotifySink::OnLanguageChange is not triggered, too; ITfLanguageProfileNotifySink::OnLanguageChanged is triggered only when the main window of my program is in foreground, but it doesn't contain any information on the language. Is there any way to monitor input language change event globally?
I found another way to detect such changes: to use SetWindowsHookEx with WH_SHELL. One of the available event is HSHELL_LANGUAGE which is exactly what I need and the test project seems to work just fine.
There's an article by Alexander Shestakov that describes a program very similar to what I'm trying to achieve and it also has a link to github project that I use as an example.

Is it possible for a DLL to open explorer?

Im trying to make (what I thought was a simple) extension for Game maker studio 2.
I am restricted to making a DLL app.
I am wondering is there any was to have a dll app open the file explorer have the user locate a file and then return said directory?
I fell like this is a sumb question but one I really need to know the answer too before slaving away coding for hours only to find its not possible.
You do not want to launch the explorer but to open a file dialog that allows the user to select a file.
Depending on the framework you use in your program the solutions may differ.
If you are using Qt framework you may use a QFileDialog for a platform independent mechanism.
If you are okay that it will only works on Windows then you may directly use the WinAPI functions GetOpenFileName or GetSaveFileName (that is a lot easier than the Common Item Dialog that is suggested as replacement on their documentation pages)
On GameMaker terms, you want to use get_open_filename or get_open_filename_ext.
See Dialog Module (marketplace, github) for C++ implementation reference.

How to create a custom theme for QtCreator

I would like to create and share a free Qt app for easy creation of custom QtCreator themes. My problem though is not the creation of the app itself, but the format of the *.creatortheme file.
I have made a copy of the flat.creatortheme found under Tools\QtCreator\share\qtcreator\themes and since I can't find the names of the variables documented anywhere, I used the trial-and-error approach in order to figure out the meaning of the variables. For the most of them I've succeeded. However for the ones starting with Timeline_ and VcsBase_ I can't see any change in the visual appearence for my setup of the IDE (Qt 5.10.0, MSVC 2017, Windows 7).
So if I make that just for myself, that would be enough, but since I would like to share the app with the rest of you, I think I should cover those values as well.
Does anyone have an experience with this?
Any help will be appreciated.
In the source code of Qt Creator those are listed in the Color enum of the Theme class:
...
/* Timeline Library */
Timeline_TextColor,
Timeline_BackgroundColor1,
Timeline_BackgroundColor2,
Timeline_DividerColor,
Timeline_HighlightColor,
Timeline_PanelBackgroundColor,
Timeline_PanelHeaderColor,
Timeline_HandleColor,
Timeline_RangeColor,
/* VcsBase Plugin */
VcsBase_FileStatusUnknown_TextColor,
VcsBase_FileAdded_TextColor,
VcsBase_FileModified_TextColor,
VcsBase_FileDeleted_TextColor,
VcsBase_FileRenamed_TextColor,
VcsBase_FileUnmerged_TextColor,
...
According to the comments, they are used by the Timeline Library and the VcsBase Plugin.

How to retrieve all the event logs at the Windows XP?

As we know, windows event logs are different at below Vista (XP and below) and Vista and up, see here Windows Event Logs . On Vista, I am able to understand the API about how to retrieve all event logs.
On the windows XP, I am able to run this sample code. Two things we need to fill in there are:
#define PROVIDER_NAME L"MyEventProvider"
#define RESOURCE_DLL L"<path>\\Provider.dll"
However the question would be there where to get the provider name and its resource dll.
One way I could think of is to iterate through all the sub key under registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\System
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security
From those subkeys, we could get the provider name and its EventMessageFile (although I found out that some subkey doesn't have the EventMessageFile, rather it hasParameterMessageFile).
Is this the only way to do this? Or is there any other better approach?
If you are using WinAPI, than iterating through registry is the only way, as far as I know. And yes, some of providers don't have EventMessageFile, it's normal. Maybe they are just place their insert strings without any message into event log (I can't say exactly).
But, if you can use a .Net, that there is a good EventLog Class, that offers you a bunch of really good methods.

How to use SAPI's SetNotifyCallbackFunction() in a CLR project with Windows Form as the interface window?

I'm trying to write a dll plugin for Winamp. I'm using Microsoft Visual Studio 2008 and Microsoft SAPI 5.1. I created the interface window using Windows Form (System::Windows::Forms::Form).
I tried to use SetNotifyWIndowMessage(), but the method is never called when I speak to the microphone. So I tried using SetNotifyCallbackFunction(), but I got a compile error saying that I should use '&' in front of the method name in the parameter. However, when I add the '&', I got another compile error saying that i can't take the address of the method unless creating delegate instance.
What should I do? Someone please help me..
Well, as indicated, you need to create a delegate instance to wrap your callback. But don't go there, SAPI 5.1 is quite outdated. Updates are no longer shipped because the .NET framework has a very nice wrapper for it. Check out the System.Speech.Recognition namespace and the SpeechRecognitionEngine class. You'll want to use the SpeechRegonized event. You'll find plenty of code samples in the MSDN Library pages for the class.