added Search Online for modules

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2929 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2010-03-07 07:23:41 +00:00
parent 9e36d92114
commit d61698a2f5
8 changed files with 95 additions and 23 deletions
+1
View File
@@ -163,6 +163,7 @@ BEGIN
BEGIN
MENUITEM "Unload", ID_MODULE_UNLOAD
MENUITEM SEPARATOR
MENUITEM "Search Online", ID_MODULE_SEARCHONLINE
MENUITEM "Open Containing Folder", ID_MODULE_OPENCONTAININGFOLDER
MENUITEM "Properties", ID_MODULE_PROPERTIES
END
@@ -540,6 +540,10 @@
RelativePath=".\support.c"
>
</File>
<File
RelativePath=".\support2.c"
>
</File>
<File
RelativePath=".\symprv.c"
>
+7
View File
@@ -548,6 +548,13 @@ FORCEINLINE ULONG PhGetColorBrightness(
return (min + max) / 2;
}
// support2
VOID PhSearchOnlineString(
__in HWND hWnd,
__in PWSTR String
);
// mainwnd
#ifndef MAINWND_PRIVATE
+1 -20
View File
@@ -748,26 +748,7 @@ LRESULT CALLBACK PhMainWndProc(
if (processItem)
{
PPH_STRING searchEngine = PHA_DEREFERENCE(PhGetStringSetting(L"SearchEngine"));
ULONG indexOfReplacement = PhStringIndexOfString(searchEngine, 0, L"%s");
if (indexOfReplacement != -1)
{
PPH_STRING newString;
// Replace "%s" with the process name.
newString = PhaConcatStrings(
3,
PhaSubstring(searchEngine, 0, indexOfReplacement)->Buffer,
processItem->ProcessName->Buffer,
PhaSubstring(
searchEngine,
indexOfReplacement + 2,
searchEngine->Length / 2 - indexOfReplacement - 2
)->Buffer
);
PhShellExecute(hWnd, newString->Buffer, NULL);
}
PhSearchOnlineString(hWnd, processItem->ProcessName->Buffer);
}
}
break;
+7 -1
View File
@@ -258,14 +258,20 @@ INT_PTR CALLBACK PhpProcessMiniDumpDlgProc(
{
PPROCESS_MINIDUMP_CONTEXT context = (PPROCESS_MINIDUMP_CONTEXT)lParam;
PhCenterWindow(hwndDlg, GetParent(hwndDlg));
SetProp(hwndDlg, L"Context", (HANDLE)context);
SetDlgItemText(hwndDlg, IDC_PROGRESSTEXT, L"Creating the dump file...");
if (WindowsVersion >= WINDOWS_XP)
SendMessage(GetDlgItem(hwndDlg, IDC_PROGRESS), PBM_SETMARQUEE, TRUE, 250);
{
PhSetWindowStyle(GetDlgItem(hwndDlg, IDC_PROGRESS), PBS_MARQUEE, PBS_MARQUEE);
SendMessage(GetDlgItem(hwndDlg, IDC_PROGRESS), PBM_SETMARQUEE, TRUE, 75);
}
else
{
ShowWindow(GetDlgItem(hwndDlg, IDC_PROGRESS), SW_HIDE);
}
context->WindowHandle = hwndDlg;
context->ThreadHandle = PhCreateThread(0, PhpProcessMiniDumpThreadStart, context);
+10
View File
@@ -2032,6 +2032,16 @@ INT_PTR CALLBACK PhpProcessModulesDlgProc(
}
}
break;
case ID_MODULE_SEARCHONLINE:
{
PPH_MODULE_ITEM moduleItem = PhGetSelectedListViewItemParam(lvHandle);
if (moduleItem)
{
PhSearchOnlineString(hwndDlg, moduleItem->Name->Buffer);
}
}
break;
case ID_MODULE_OPENCONTAININGFOLDER:
{
PPH_MODULE_ITEM moduleItem = PhGetSelectedListViewItemParam(lvHandle);
+2 -2
View File
@@ -33,7 +33,6 @@
#define IDR_FINDOBJ 134
#define IDD_HIDDENPROCESSES 135
#define IDD_RUNAS 136
#define IDD_DIALOG2 137
#define IDD_PROGRESS 137
#define IDC_TERMINATE 1003
#define IDC_FILEICON 1005
@@ -218,6 +217,7 @@
#define ID_OBJECT_PROPERTIES 40120
#define ID_OBJECT_PROCESSPROPERTIES 40121
#define ID_HELP_DEBUGCONSOLE 40122
#define ID_MODULE_SEARCHONLINE 40125
#define IDDYNAMIC 50000
// Next default values for new objects
@@ -225,7 +225,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 138
#define _APS_NEXT_COMMAND_VALUE 40125
#define _APS_NEXT_COMMAND_VALUE 40126
#define _APS_NEXT_CONTROL_VALUE 1078
#define _APS_NEXT_SYMED_VALUE 107
#endif
+63
View File
@@ -0,0 +1,63 @@
/*
* Process Hacker -
* application support functions
*
* Copyright (C) 2010 wj32
*
* This file is part of Process Hacker.
*
* Process Hacker is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Process Hacker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
*/
#include <phgui.h>
#include <settings.h>
VOID PhSearchOnlineString(
__in HWND hWnd,
__in PWSTR String
)
{
PPH_STRING searchEngine = PhGetStringSetting(L"SearchEngine");
ULONG indexOfReplacement = PhStringIndexOfString(searchEngine, 0, L"%s");
if (indexOfReplacement != -1)
{
PPH_STRING stringBefore;
PPH_STRING stringAfter;
PPH_STRING newString;
// Replace "%s" with the string.
stringBefore = PhSubstring(searchEngine, 0, indexOfReplacement);
stringAfter = PhSubstring(
searchEngine,
indexOfReplacement + 2,
searchEngine->Length / 2 - indexOfReplacement - 2
);
newString = PhConcatStrings(
3,
stringBefore->Buffer,
String,
stringAfter->Buffer
);
PhShellExecute(hWnd, newString->Buffer, NULL);
PhDereferenceObject(newString);
PhDereferenceObject(stringAfter);
PhDereferenceObject(stringBefore);
}
PhDereferenceObject(searchEngine);
}