{"id":19052739,"url":"https://github.com/soul-master/aquery","last_synced_at":"2025-06-11T09:32:59.580Z","repository":{"id":74167163,"uuid":"47386020","full_name":"Soul-Master/aQuery","owner":"Soul-Master","description":"Window automation-based Query (a fluent jQuery-like API)","archived":false,"fork":false,"pushed_at":"2015-12-13T07:47:44.000Z","size":287,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T00:43:54.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Soul-Master.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-04T06:31:09.000Z","updated_at":"2023-11-01T15:12:16.000Z","dependencies_parsed_at":"2023-03-15T02:47:06.396Z","dependency_job_id":null,"html_url":"https://github.com/Soul-Master/aQuery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soul-Master%2FaQuery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soul-Master%2FaQuery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soul-Master%2FaQuery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soul-Master%2FaQuery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soul-Master","download_url":"https://codeload.github.com/Soul-Master/aQuery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soul-Master%2FaQuery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259239080,"owners_count":22826855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T23:27:47.399Z","updated_at":"2025-06-11T09:32:59.561Z","avatar_url":"https://github.com/Soul-Master.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[aQuery](https://github.com/Soul-Master/aQuery)\n==================================================\n\naQuery is a fast, small, and feature-rich C# library that based on [Windows Automation API](https://msdn.microsoft.com/en-us/library/windows/desktop/ff486375(v=vs.85).aspx). It makes things like Windows control traversal and manipulation much simpler with an easy-to-use API that works across variety of desktop control like C++ control, windows forms or even WPF. With a combination of versatility and extensibility, aQuery has changed the way that people write automation on Windows application.\n\nOverview\n---------\n\n![Overview image](https://cdn.rawgit.com/Soul-Master/aQuery/master/aQuery/Overview.PNG)\n\nHere is the simplest form of aQuery syntax. The following statement use aQuery to select window element with ProcessId equals `1234`\n\n```C#\n// Syntax of C# 6.0\nusing static aQuery.aQuery;\n\nvar window = a(\"window[ProcessId=1234]\");\n```\n\nAfter you can retrieve element from given `context` (default context is desktop), you can manipulate it via built-in methods like the following statements.\n\n```C#\n// Trigger click via InvokePattern\nwindow.Click();\n```\n\n*[InvokePattern](https://msdn.microsoft.com/en-us/library/system.windows.automation.invokepattern(v=vs.110).aspx) represents controls that initiate or perform a single, unambiguous action and do not maintain state when activated.\n\nSelectors\n---------\nAs you know, the hardest part of automating application on Windows desktop is selecting control. Normally, application isn't designed to be queried. Control structure doesn't look simple just like normal web page.\n\n![Calculator App](https://cdn.rawgit.com/Soul-Master/aQuery/master/demo/Calculator1.png)\n\nMost of control properties that we can retrieve via  [AutomationElement](https://msdn.microsoft.com/en-us/library/system.windows.automation.automationelement(v=vs.110).aspx) doesn't unique. We cannot select control by using only one property.\n\n![Calculator App](https://cdn.rawgit.com/Soul-Master/aQuery/master/demo/Calculator2.png) \n\nSo I decide to simplify this process by creating aQuery (AutomationElement wrapper) that can query element with jQuery-syntax like command. This is the syntax that currently supports by aQuery.\n\n```text\n'{Name Property}' {LocalizedControlType}[{PropertyName}={PropertyValue}]:{filterName}({filterValue})\n```\n\nFor selecting title bar of Calculator, you can use one of the following selectors if it doesn't duplicate with other controls.\n\n- `\"'Calculator'\"` specify only Name property\n- `\"title bar\"` specify only LocalizedControlType property\n- `\"'Calculator' title bar\"` specify by Name and LocalizedControlType properties\n- `[AutomationId=TitleBar][ControlType=ControlType.TitleBar]` specify by some properties\n- `title bar:first` specify by `LocalizedControlType` property and get the first one\n\nFor more example, please look at source code of [aQuery.Amibroker](https://github.com/Soul-Master/aQuery/tree/master/aQuery.Amibroker) project. It contains a lot of useful code for using aQuery.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoul-master%2Faquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoul-master%2Faquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoul-master%2Faquery/lists"}