Classic Shell
http://www.classicshell.net/forum/

Possible to highlight top custom search when no Apps found
http://www.classicshell.net/forum/viewtopic.php?f=7&t=726
Page 1 of 1

Author:  jpv [ Wed Jun 05, 2013 11:03 pm ]
Post subject:  Possible to highlight top custom search when no Apps found

I have search enabled on my start menu and several custom search menus. Normally if a search returns item(s) from programs/path, the top result is highlighted. However, if there are no results, you have to go back to the mouse, or use the arrow keys to highlight the custom search.

Is there a way to make it so if no app results are found, the top custom search menu item is highlighted, so you can just press enter after typing the search string?

Thanks!

Author:  Ivo [ Wed Jun 05, 2013 11:23 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

The thing is the search box also accepts commands. If there are no search results then the text you typed is considered a command and will be executed with Enter.

Author:  Jcee [ Thu Jun 06, 2013 12:23 am ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

what if it detected if what your typing is actually a command or not? then acted accordingly (i know a window pops up saying "Windows cannot find 'YourQuery'. Make sure you typed the name correctly), so it should just be a matter of detecting that window, automatically closing it, and re-directing the text :P

although personally i dont care either way, this is just a possible way to do it :P

Author:  Ivo [ Thu Jun 06, 2013 8:40 am ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

It is hard to know if something is going to be a valid command or not. Maybe it is an exe that's in the path, or maybe in the AppPaths regsity, or maybe it is a document, or a website, or something entirely different that Windows accepts as a command.
I do not have an exhaustive list of everything that's acceptable, and how to check for its validity.

Author:  Jcee [ Thu Jun 06, 2013 3:48 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

and theres no way to detect the popup of the window that tells you its an invalid path?

Author:  Ivo [ Thu Jun 06, 2013 3:53 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

Maybe there is, but for that I have to try to execute the command first. We don't want anything to be executed until you press Enter.

Author:  Jcee [ Thu Jun 06, 2013 6:58 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

ah ok :P

Author:  jpv [ Thu Jun 06, 2013 10:13 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

I was going to play around with changing MenuCommands.cpp form

Code:
if (bShift && bCtrl)
ExecuteCommandElevated(buf);
else
ExecuteCommand(buf);

to something like this:

Code:
if (bShift && bCtrl)
ExecuteCommandElevated(buf);
else if (bShift)
ExecuteCommand(buf);
else
ActivateItem(0,ACTIVATE_SELECT,NULL);


But I got this error compiling, even before making changes:
Quote:
Error1fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directoryc:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h28ClassicShellLib

Author:  Ivo [ Thu Jun 06, 2013 10:16 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

Looks like the error message got mangled somehow.
What is the exact message, what version of Visual Studio are you using, and what version of the Windows SDK?

Author:  jpv [ Fri Jun 07, 2013 12:04 am ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

I am running VS 2008 and have the Win7 SDK. Do I need the Win8 one? Do I have to manually add references to the project?

I get lots of these errors:

Error 1 fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h 28 ClassicShellLib

Author:  jpv [ Sat Jun 08, 2013 10:28 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

Let me know if you have any ideas how I can implement this myself, I think this would be a good thing to have as an option in settings, either run as a command or run as the first default search item (could run the other option when Shift depressed--e.g. can run a command in that mode instead of the search when shift is pressed).

Author:  Ivo [ Sat Jun 08, 2013 10:35 pm ]
Post subject:  Re: Possible to highlight top custom search when no Apps fou

You can set a shortcut for the search, like Alt+I for Internet search

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/