#include <acknex.h>
#include <windows.h>
#include <default.c>
#define LPWSTR char*
#define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
#define MAKEINTRESOURCE MAKEINTRESOURCEW
#define IDI_WINLOGO MAKEINTRESOURCE(32517)
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
HWND hwnd1;
char cname[4] = {0x62, 0x6C, 0x61, 0}; // "bla"
void main ()
{
wait(1);
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon (NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) GetStockObject (LTGRAY_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = cname;
RegisterClass (&wc);
hwnd1 = CreateWindowEx
(
0,
cname,
"Your Subwindow",
WS_OVERLAPPEDWINDOW | WS_POPUP,
400, 400, 400, 400,
hWnd,
0,
hInstance,
0
);
ShowWindow (hwnd1, SW_SHOWNORMAL);
MSG msg;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
wait(1);
}
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_LBUTTONDOWN:
MessageBox(0,"Left mouse button pressed inside your subwindow!","!!!",MB_OK);
return 0;
}
return DefWindowProc (hwnd, message, wParam, lParam);
}