mirror of
https://github.com/brain-hackers/brainlilo
synced 2024-12-22 20:20:04 +09:00
Remove unused functions and headers
This commit is contained in:
parent
a128053742
commit
a7f9d3126b
@ -1,48 +1,7 @@
|
|||||||
// This file is in public domain.
|
// This file is in public domain.
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <tchar.h>
|
|
||||||
#include <vector>
|
|
||||||
#include <windows.h>
|
#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)
|
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR lpCmd, int nShow)
|
||||||
{
|
{
|
||||||
HINSTANCE lib = LoadLibrary(L"BrainLILO");
|
HINSTANCE lib = LoadLibrary(L"BrainLILO");
|
||||||
|
Loading…
Reference in New Issue
Block a user