Windows 10 – The Industrious Squirrel https://blog.chadweisshaar.com Tue, 20 Sep 2016 01:07:23 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://blog.chadweisshaar.com/wp-content/uploads/2016/07/favicon.png Windows 10 – The Industrious Squirrel https://blog.chadweisshaar.com 32 32 Programmatic use of windows search https://blog.chadweisshaar.com/2016/09/19/programmatic-use-of-windows-search/ https://blog.chadweisshaar.com/2016/09/19/programmatic-use-of-windows-search/#respond Tue, 20 Sep 2016 01:07:23 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=985 Continue reading "Programmatic use of windows search"]]> I recently wanted to add a photo search capability to my Timeline program and discovered that you can open a windows explorer with a custom search. You can also type these searches directly into the address bar in a windows file explorer.

The key is the search-ms protocol. It allows programs (like windows explorer) to directly query the windows search index. The parameters to this command are somewhat obscure, but it is very flexible and it can be used to perform any search that you could perform with the graphical search function in the windows file explorer.

For my application, I wanted to search for all photos that were taken between two dates (the start and end date of an event on my timeline). The idea is to quickly find all the photos that I took on a trip or at an event.

The general syntax for the search-ms command is:

search-ms:query=<query string>&
          crumb=<location and display parameters>&
          syntax=<NQS or AQS(default)>

The query string can be any valid SQL or AQS search. For my application I wanted to query on the date my photo was taken which windows stores as “datetaken” and I wanted to query over a range of dates. Dates have to be in the YYYY-MM-DD format, and a range is specified with “..”.

I used the crumb specifier to target a just the “My Pictures” special folder. To specify a location you put crumb=location:<URL encoded path>. For a special folder you do crumb=location:shell%3a<folder name>.

So my final query string is:

search-ms:query=datetaken:2015-01-01..2016-01-01&crumb=location:shell%3aMy%20Pictures

You can type or copy this into your search bar to see all the photos you took in 2015.

From C# you can start a process by giving the name of a file that has a default program association. So launching a file explorer with a custom search is as easy as:

System.Diagnostics.Process.Start("search-ms:query=datetaken:" + 
  Start().ToString("yyyy-MM-dd") + ".." + End().ToString("yyyy-MM-dd") +
  "&crumb=location:shell%3aMy%20Pictures");
]]>
https://blog.chadweisshaar.com/2016/09/19/programmatic-use-of-windows-search/feed/ 0
How to: Turn off Windows 10 lock screen after sleep https://blog.chadweisshaar.com/2016/05/27/how-to-turn-off-windows-10-lock-screen-after-sleep/ https://blog.chadweisshaar.com/2016/05/27/how-to-turn-off-windows-10-lock-screen-after-sleep/#respond Fri, 27 May 2016 14:34:22 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=884 Continue reading "How to: Turn off Windows 10 lock screen after sleep"]]> There are THREE places where you can change what happens when the computer comes back from sleep. I have instructions for turning off the screen lock followed by a short rant.

  1. Power settings: Control Panel -> Hardware and Sound -> Power Options -> Require a password on wakeup. Then click “Change settings that are currently unavailable” and then select “Don’t require a password”.Power-BIn a sane operating system, this would be all you’d have to do. But there are two other things that can bring up the lock screen.
  2. Advanced Power settings. Bring up the power options in the control panel (Hardware and Sound -> Power Options -> Change plan settings). Then click “Changed advanced power settings”Power-1For each power profile that your computer uses, set:Power-2
  3. Screen saver. Search the control panel for screen saver and select “Change screen saver”. Turn off the “On resume, display logon screen” setting.ScreenSaver

This situation is ridiculous and highlights three problems that have crept into Windows over time.

  1. Multiple ways to change the same setting. As Windows has gotten bigger and more customizable, we’ve started to see multiple ways to accomplish the same task. Unfortunately these different setting can conflict with each other. Each of the screens above seems very straightforward when considered alone. But when you set “Don’t require a password” in the first step above, most people would not think they needed to change the same setting in two other places.
  2. In Windows 8, Microsoft started using the “Metro” style control panels. This was fine since it was a simpler view for users of the Metro interface. But now in Windows 10, those Metro control panels have crept onto the desktop and often provide a redundant way to change the same setting. But more often they just require a second click to get where you need to be:MetroPower
  3. Frequent updates. My computer started requiring a password coming out of sleep three days ago. I assume it was a Windows update, but I can’t tell. It may have been cause by another application. Either way, user preferences should never be changed by an update. The worst offender was the first big update (the un-named update that happened in November 2015 and ended with the “All your files are where you left them“) which changed lots of settings for some users. All these updates also make it very difficult to find solutions to a problem. I searched around on Google for 15 minutes this morning to figure this out and the problem is that the setting have moved around over time. This post will probably only be valid for 6 months or so.

 

]]>
https://blog.chadweisshaar.com/2016/05/27/how-to-turn-off-windows-10-lock-screen-after-sleep/feed/ 0