#define WIN32_LEAN_AND_MEAN #define UNICODE #include static unsigned destroyed,custom,contexts; static HWND context_owner; static LPARAM context_position; __declspec(dllexport) volatile unsigned phase; static LRESULT CALLBACK procedure(HWND window,UINT message,WPARAM wparam,LPARAM lparam) { if (message==WM_CONTEXTMENU) { ++contexts; context_owner=(HWND)wparam; context_position=lparam; if (contexts==1) return 41; } if (message==WM_DESTROY) { ++destroyed; PostQuitMessage(23); } if (custom && message==WM_GETTEXTLENGTH) return 42; if (custom && message==WM_SETTEXT) return 1; return DefWindowProcW(window,message,wparam,lparam); } int raven_entry(void) { HINSTANCE instance=GetModuleHandleW(NULL); WNDCLASSEXW definition={0}; definition.cbSize=sizeof(definition); definition.hInstance=instance; definition.lpfnWndProc=procedure; definition.lpszClassName=L"RavenDefaultContract"; ATOM atom=RegisterClassExW(&definition); if (!atom) return 1; HWND window=CreateWindowExW(0,MAKEINTATOM(atom),L"initial",WS_POPUP,1,2,32,32,NULL,NULL,instance,NULL); if (!window) return 2; if (SendMessageW(window,WM_NCHITTEST,0,MAKELPARAM(2,3))!=HTCLIENT || SendMessageW(window,WM_NCHITTEST,0,MAKELPARAM(-2,-3))!=HTNOWHERE) return 15; const UINT pointer_messages[]={WM_MOUSEMOVE,WM_LBUTTONDOWN,WM_LBUTTONUP,WM_RBUTTONDOWN,WM_RBUTTONUP,WM_MBUTTONDOWN,WM_MBUTTONUP}; for (unsigned i=0;i