Remove unused functions and headers

This commit is contained in:
Takumi Sueda 2022-04-19 01:24:24 +09:00
parent a128053742
commit a7f9d3126b
1 changed files with 0 additions and 41 deletions

View File

@ -1,48 +1,7 @@
// This file is in public domain.
#include <algorithm>
#include <tchar.h>
#include <vector>
#include <windows.h>
#define MainWindowClassName L"SelectorMainWindowClass"
#define DataTypeAlertError 0x1000
#define DataTypeAlertInformation 0x1001
#define DataTypeAlertWarning 0x1002
static void showAlertWarning(LPCWSTR message, LPCWSTR title)
{
HWND selectorMainWindow = FindWindow(MainWindowClassName, NULL);
if (!selectorMainWindow)
{
MessageBox(NULL, message, title, MB_ICONWARNING);
return;
}
wchar_t data[2048];
wcscpy(data, message);
data[wcslen(message)] = 0;
wcscpy(data + wcslen(message) + 1, title);
size_t dataLen = wcslen(message) + wcslen(title) + 1;
COPYDATASTRUCT info;
info.dwData = DataTypeAlertWarning;
info.cbData = dataLen * sizeof(wchar_t);
HGLOBAL global = GlobalAlloc(GPTR, info.cbData);
memcpy((LPVOID)global, data, info.cbData);
info.lpData = (LPVOID)global;
SendMessage(selectorMainWindow, WM_COPYDATA, NULL, (LPARAM)&info);
GlobalFree(global);
}
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR lpCmd, int nShow)
{
HINSTANCE lib = LoadLibrary(L"BrainLILO");