34#define APP_NAME "wpickclick.exe"
47#define __PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
49#define __PRINTF_ATTR(fmt,args)
103 while (*
str==
' ' || *
str==
'\t' || *
str==
'\r' || *
str==
'\n')
108 while (
s>
str && (*
s==
' ' || *
s==
'\t' || *
s==
'\r' || *
s==
'\n'))
115 LPSTR lpCmdLine,
int nCmdShow)
126 if (
strstr(lpCmdLine,
"--help"))
128 fprintf(
stderr,
"%s - Utility to print coordinates, component, window title, component class and window class name of a click\n",
APP_NAME);
129 fprintf(
stderr,
"----------------------------------------------\n");
133 fprintf(
stderr,
"select where to click. If we properly track the click, it will be reported\n");
135 fprintf(
stderr,
" button-name x y component_name window_name component_class_name window_class_name\n");
136 fprintf(
stderr,
"Note that x and y can be negative; this typically happens if you click within the\n");
137 fprintf(
stderr,
"window manager decorations of a given window.\n");
155 if (!pInstallHooks || !pRemoveHooks || !
pGetAction)
157 fprintf(
stderr,
"Error: Unable to get the hook.dll functions (%ld)\n",
163 if (!pInstallHooks(hDll))
165 fprintf(
stderr,
"Error: Unable to install the hooks (%ld)\n",
194 printf(
"button%d %ld %ld\n",
action->action-ACTION_BUTTON1+1,
208 cxlog(
"\n%s: action=%d x=%ld y=%ld\n", __FILE__,
action->action,
210 cxlog(
"window_class='%s'\n",
action->window_class);
211 cxlog(
"window_title='%s'\n",
action->window_title);
213 cxlog(
"control_class='%s'\n",
action->control_class);
214 cxlog(
"control_caption='%s'\n",
action->control_caption);
char * strcat(char *DstString, const char *SrcString)
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
char * strchr(const char *String, int ch)
#define _setmode(fd, mode)
#define GetProcAddress(x, y)
static void cleanup(void)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
static __ms_va_list valist
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
DWORD WINAPI GetLastError(void)
#define GetModuleFileName
static action_t *WINAPI * pGetAction()
static void cxlog(const char *format,...) __PRINTF_ATTR(1
static HINSTANCE load_hook_dll()
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
#define __PRINTF_ATTR(fmt, args)