private SearchProviderResult GenerateResult(string displayName, string description = "")
 {
     var result = new SearchProviderResult(this)
     {
         DisplayName = displayName,
         Description = description
     };
     result.SetIcon(Resources.cmd.ToBitmap());
     result.Path = result.DisplayName;
     return result;
 }
        protected override List<SearchProviderResult> DoSearch(SearchQuery q)
        {
            var list = new List<SearchProviderResult>();

            foreach (var process in Process.GetProcesses().Where(t => t.SessionId == currentSessionId))
            {

                var procLower = process.ProcessName.ToLower();
                var query = q.QueryString;
                var searchLower = query.ToLower();

                if (procLower.Contains(searchLower) || searchLower.Contains(procLower) || query == "*")
                {

                    var result = new SearchProviderResult(this)
                    {
                        DisplayName = string.Format("{0}", process.ProcessName),
                        ProviderMetadata = process,
                        Priority = SearchProviderResult.PriorityLow,
                        Description = "<h3><img src='data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7' />" + process.ProcessName + "</h3>"
                        // GroupName = "Kill"
                    };

                    result.SetEnterKeyAction((x) =>
                    {
                        var p = result.ProviderMetadata as Process;

                        if (p != null)
                            p.Kill();
                        return true;
                    });

                    try
                    {
                        if (!String.IsNullOrEmpty(process.MainModule.FileName))
                        {
                            result.SetIconFromFilePath(process.MainModule.FileName);
                        }

                    }
                    catch (Exception)
                    {

                        result.SetIcon(Properties.Resources.Application);
                    }
                    list.Add(result);
                }
            };

            return list;
        }