Hyperlinks in dialog boxes #1499
-
I'm part of a student project trying to add support for MetaDefender Cloud to System Informer as a compliment to VirusTotal (see 1373). I'm trying to find a way to add clickable hyperlinks to a couple of dialog boxes within the OnlineChecks plugin. The first is a popup dialog for inputting an API key. I've used PhCreateWindow() in a similar way to the network ping tool, which gets the key just fine, but I haven't found a way to put a hyperlink in the dialog text (a link to obtain an API key). The second is a error dialog shown when exceeding the daily usage limit. I can parse the HTTP 429 response and use RaiseUploadError() to display a message, but haven't found a way to format hyperlinks with that function. I'm now experimenting with CreateWindowEx(). I've been reading the docs on SysLink Controls and here is my attempt to call CreateWindowEx() using their sample code from within UploadCheckThreadStart(). else if (code == 429000)
{
CreateWindowExW(0, WC_LINK,
L"For more information, <A HREF=\"https://www.microsoft.com\">click here</A> ",
WS_VISIBLE | WS_CHILD | WS_TABSTOP,
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
context->DialogHandle, NULL, PluginInstance->DllBase, NULL);
} I'm not sure if I'm calling it correctly, it seems to just hang on the "scanning" dialog. Particularly unsure if I'm using the right handle and instance. Is there a way to do any of this? An alternative to links would be a button that acts as a link, but I'm unsure if that's any easier. Any help would be much appreciated, this has been stumping me for over a week. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You have to use a dialog box or a rich edit control. Visual Studio > View > Other Windows > Resource View (opens on right side of screen) -> Expand solution -> Add resource -> Dialog Then just drag+drop controls from the editor to the dialog and show the dialog using the DialogBox function: |
Beta Was this translation helpful? Give feedback.
-
Sorry to keep spamming my own thread, but I have a followup issue. I have my custom error/dialog box appearing over the "Scanning processname..." dialog whenever I get a 429 response (first image), which is fine, but when I close my dialog box the the "Scanning..." dialog remains indefinitely (second image). How can I graceful have the program close this dialog/stop the scanning process after my dialog is closed? The normal calls to |
Beta Was this translation helpful? Give feedback.
You have to use a dialog box or a rich edit control.
Visual Studio > View > Other Windows > Resource View (opens on right side of screen) -> Expand solution -> Add resource -> Dialog
Then just drag+drop controls from the editor to the dialog and show the dialog using the DialogBox function: