27 #define IS_PLUGIN_LOADED(Plugin) (!!(Plugin)->AppContext.AppName.Buffer)
28 #define STR_OR_DEFAULT(String, Default) ((String) ? (String) : (Default))
30 static HWND PluginsLv;
32 static PPH_LIST DisabledPluginInstances;
43 _In_ HWND ParentWindowHandle
58 L
"Plugins are not enabled. To use plugins enable them in Options and restart Process Hacker.");
72 return baseNamePart.
Buffer;
74 return Plugin->FileName->Buffer;
79 return Plugin->Name.Buffer;
104 if (SelectedPlugin && SelectedPlugin->
FileName)
106 fileName = SelectedPlugin->
FileName;
132 SetDlgItemText(hwndDlg,
IDC_NAME, L
"N/A");
136 SetDlgItemText(hwndDlg,
IDC_URL, L
"N/A");
140 ShowWindow(GetDlgItem(hwndDlg,
IDC_OPENURL), SW_HIDE);
195 plugin->
Name.
Buffer = PhAllocate(BaseName->Length +
sizeof(WCHAR));
196 memcpy(plugin->
Name.
Buffer, BaseName->Buffer, BaseName->Length);
197 plugin->
Name.
Buffer[BaseName->Length / 2] = 0;
206 PhFree(Plugin->Name.Buffer);
222 remainingPart = disabled->
sr;
224 while (remainingPart.
Length != 0)
250 _In_ BOOLEAN NewDisabledState
253 if (NewDisabledState)
264 assert(!NewDisabledState);
265 ListView_DeleteItem(PluginsLv, ItemIndex);
268 InvalidateRect(PluginsLv, NULL,
TRUE);
273 static COLORREF PhpPluginColorFunction(
282 return RGB(0x77, 0x77, 0x77);
284 return GetSysColor(COLOR_WINDOW);
300 PluginsLv = GetDlgItem(hwndDlg,
IDC_LIST);
339 SelectedPlugin = NULL;
347 for (i = 0; i < DisabledPluginInstances->
Count; i++)
356 switch (LOWORD(wParam))
360 EndDialog(hwndDlg, IDOK);
368 BOOLEAN newDisabledState;
391 L
"Do you want to clean up unused plugin settings?") == IDYES)
407 LPNMHDR header = (LPNMHDR)lParam;
409 switch (header->code)
411 case LVN_ITEMCHANGED:
413 if (header->hwndFrom == PluginsLv)
415 if (ListView_GetSelectedCount(PluginsLv) == 1)
418 SelectedPlugin = NULL;
426 if (header->hwndFrom == GetDlgItem(hwndDlg,
IDC_OPENURL))
435 if (header->hwndFrom == PluginsLv)