Placeholder

This commit is contained in:
2022-10-03 15:28:11 -04:00
parent 9dc3577bc8
commit 88176d317c
3 changed files with 47 additions and 19 deletions

View File

@@ -7,27 +7,47 @@
#include <ExDispid.h> #include <ExDispid.h>
#include <shlwapi.h> #include <shlwapi.h>
int SplashHTMLLoad(std::string strHTML) void SplashHTMLContainer()
//void CreateHTMLContainer()
{ {
HWND NewWindow = CreateWindowEx( HWND invisWindowHandle = CreateWindowEx(WS_EX_TOOLWINDOW,
WS_EX_TOOLWINDOW, "htmlWindow",
"", "Splash",
"", WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME,
WS_OVERLAPPEDWINDOW|WS_VISIBLE, 200,
0, 200,
0,
500, 500,
300, 300,
0, NULL,
0, NULL,
HINSTANCE(NULL), NULL,
NULL); NULL);
ShowWindow(NewWindow, 1); printf("Creating Window HWND: %u\n", invisWindowHandle);
UpdateWindow(NewWindow); ShowWindow(invisWindowHandle, 1);
UpdateWindow(invisWindowHandle);
}
int SplashHTMLLoad(std::string strHTML)
{
IHTMLDocument2 *document = new IHTMLDocument2{}; // Declared earlier in the code
BSTR bstr = SysAllocString(OLESTR("Written by IHTMLDocument2::write()."));
// Creates a new one-dimensional array
SAFEARRAY *psaStrings = SafeArrayCreateVector(VT_VARIANT, 0, 1);
if (psaStrings == NULL) {
goto cleanup;
}
VARIANT *param;
HRESULT hr = SafeArrayAccessData(psaStrings, (LPVOID*)&param);
param->vt = VT_BSTR;
param->bstrVal = bstr;
hr = SafeArrayUnaccessData(psaStrings);
hr = document->write(psaStrings);
cleanup:
// SafeArrayDestroy calls SysFreeString for each BSTR
if (psaStrings != NULL) {
SafeArrayDestroy(psaStrings);
}
return 0; return 0;
} }
int SplashHTMLLoadz(std::string strHTML) int PLACEHOLDER(std::wstring strHTML)
{ {
//CreateHTMLContainer(); //CreateHTMLContainer();
printf("%s \n", strHTML.c_str()); printf("%s \n", strHTML.c_str());

View File

@@ -1,2 +1,3 @@
#include <string> #include <string>
int SplashHTMLLoad(std::string); //int SplashHTMLLoad(std::string strHTML);
int SplashHTMLLoad(std::string strHTML);

View File

@@ -20,6 +20,11 @@ DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
EXCEPINFO excepinfo; EXCEPINFO excepinfo;
UINT nArgErr; UINT nArgErr;
LRESULT CALLBACK HtmlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hwnd, msg, wParam, lParam);
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
Application *app = (Application *)GetWindowLongPtr(hwnd, GWL_USERDATA); Application *app = (Application *)GetWindowLongPtr(hwnd, GWL_USERDATA);
@@ -184,6 +189,8 @@ int main(int argc, char** argv) {
settings.window.center = true; */ settings.window.center = true; */
HMODULE hThisInstance = GetModuleHandle(NULL); HMODULE hThisInstance = GetModuleHandle(NULL);
if (!createWindowClass("htmlWindow",HtmlProc,NULL))
return false;
if (!createWindowClass("mainHWND",WndProc,hThisInstance)) if (!createWindowClass("mainHWND",WndProc,hThisInstance))
return false; return false;
if (!createWindowClass("toolboxHWND",ToolboxProc,hThisInstance)) if (!createWindowClass("toolboxHWND",ToolboxProc,hThisInstance))