18#define IDT_AUTOUNHIDE 2
22#define APPBAR_CALLBACK (WM_USER + 100)
24#define LEFT_DOWN() mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
25#define LEFT_UP() mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
26#define MOVE(x, y) SetCursorPos((x), (y))
36 static char s_buf[32];
57 trace(
"SHAppBarMessage entered (dwMessage=%s, rc=(%ld, %ld, %ld, %ld))\n",
58 MessageOfAppBar(dwMessage),
61 trace(
"SHAppBarMessage leaved (dwMessage=%s, rc=(%ld, %ld, %ld, %ld))\n",
62 MessageOfAppBar(dwMessage),
66#define SHAppBarMessage SHAppBarMessageWrap
69#define ARRAYSIZE _countof
71void appbar_tprintf(
const TCHAR *
fmt, ...)
85#define MSGDUMP_TPRINTF appbar_tprintf
273 skip(
"failed to create thread\n");
425 if (hwndAutoHide !=
hwnd)
777 hwndActive !=
hwnd &&
778 hwndActive !=
NULL &&
850 if (
pt.x < cxScreen / 2)
857 dx = cxScreen -
pt.x;
861 if (
pt.y < cyScreen / 2)
868 dy = cyScreen -
pt.y;
872 if (cxScreen *
dy > cyScreen *
dx)
1121 if (!Window::DoRegisterClass(
hInstance))
1123 skip(
"Window::DoRegisterClass failed\n");
1133 skip(
"CreateWindowExW failed\n");
1141 skip(
"CreateWindowExW failed\n");
1150 Window::DoMainLoop();
static const TCHAR s_szName[]
void SlideWindow(HWND hwnd, LPRECT prc)
#define ok_long(expression, result)
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
int WINAPI GetThreadPriority(IN HANDLE hThread)
DWORD WINAPI GetTickCount(VOID)
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
_Check_return_ long __cdecl labs(_In_ long x)
static __inline LRESULT MSGDUMP_API MD_msgdump(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
_Out_opt_ int _Out_opt_ int * cy
#define ABM_WINDOWPOSCHANGED
#define ABM_GETTASKBARPOS
#define ABM_SETAUTOHIDEBAR
#define ABN_FULLSCREENAPP
#define ABM_GETAUTOHIDEBAR
void OnSize(HWND hwnd, UINT state, int cx, int cy)
void AppBar_Size(HWND hwnd)
BOOL AppBar_Register(HWND hwnd)
void AppBar_UnHide(HWND hwnd)
void AppBar_SetAlwaysOnTop(HWND hwnd, BOOL fOnTop)
BOOL AppBar_UnRegister(HWND hwnd)
void AppBar_SetAutoHideTimer(HWND hwnd)
void OnTimer(HWND hwnd, UINT id)
static DWORD WINAPI ActionThreadFunc(LPVOID args)
void AppBar_QuerySetPos(UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
BOOL AppBar_SetAutoHide(HWND hwnd, BOOL fHide)
UINT OnNCHitTest(HWND hwnd, int x, int y)
void OnMove(HWND hwnd, int x, int y)
void AppBar_PosChanged(PAPPBARDATA pabd)
static Window * GetAppbarData(HWND hwnd)
void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags)
BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
void OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags)
void OnAppBarCallback(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
void OnNCDestroy(HWND hwnd)
void AppBar_Hide(HWND hwnd)
void GetWorkArea(LPRECT prc) const
BOOL AppBar_SetSide(HWND hwnd, UINT uSide)
BOOL AppBar_NoAutoHide(HWND hwnd)
virtual LRESULT CALLBACK WindowProcDx(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
Window(INT cx, INT cy, BOOL fAutoHide=FALSE)
void OnWindowPosChanged(HWND hwnd, const LPWINDOWPOS lpwpos)
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
static BOOL DoRegisterClass(HINSTANCE hInstance)
void AppBar_QueryPos(HWND hwnd, LPRECT lprc)
static HWND DoCreateMainWnd(HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
void OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
BOOL AppBar_AutoHide(HWND hwnd)
void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
void AppBar_SetAutoUnhideTimer(HWND hwnd)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
TW_UINT32 TW_UINT16 TW_UINT16 MSG
HANDLE WINAPI GetCurrentThread(void)
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define THREAD_PRIORITY_HIGHEST
#define FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, fn)
#define GetWindowOwner(hwnd)
#define FORWARD_WM_NCHITTEST(hwnd, x, y, fn)
#define HANDLE_MSG(hwnd, message, fn)
#define SetWindowRedraw(hwnd, fRedraw)
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
CREATESTRUCTA * LPCREATESTRUCT
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI ReleaseCapture(void)
HWND WINAPI GetForegroundWindow(void)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
#define PostThreadMessage
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetDesktopWindow(void)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
_In_ int _Inout_ LPRECT lprc
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SystemParametersInfo
#define WM_WINDOWPOSCHANGED
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)