{"id":24975155,"url":"https://github.com/jeffersonqin/max4min","last_synced_at":"2026-04-28T12:02:07.786Z","repository":{"id":108622107,"uuid":"405584805","full_name":"JeffersonQin/Max4Min","owner":"JeffersonQin","description":"🍡 Maximize windows in a way easy for minimize","archived":false,"fork":false,"pushed_at":"2022-02-13T07:58:32.000Z","size":9199,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-10T10:39:45.996Z","etag":null,"topics":["cbt-hook","cpp","csharp","global-hooks","hook","win32api","windows","wpf"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JeffersonQin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-12T08:12:12.000Z","updated_at":"2022-02-13T07:58:34.000Z","dependencies_parsed_at":"2023-04-08T19:16:24.861Z","dependency_job_id":null,"html_url":"https://github.com/JeffersonQin/Max4Min","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/JeffersonQin/Max4Min","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffersonQin%2FMax4Min","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffersonQin%2FMax4Min/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffersonQin%2FMax4Min/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffersonQin%2FMax4Min/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JeffersonQin","download_url":"https://codeload.github.com/JeffersonQin/Max4Min/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffersonQin%2FMax4Min/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32379629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cbt-hook","cpp","csharp","global-hooks","hook","win32api","windows","wpf"],"created_at":"2025-02-03T20:44:51.103Z","updated_at":"2026-04-28T12:02:07.765Z","avatar_url":"https://github.com/JeffersonQin.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 关于我想要快速最小化于是乎就重写了最大化这档子事\n\n看到这个轻小说标题一样的标题就可以知道这个项目必定不是在干什么正事。因为作者是学生，所以需要精通 Alt + tab / Win + Down 之类的技巧。然而，Windows 10 2004 以后 Alt + Tab 就开始抽风（可能会跳到莫名其妙的进程），所以只能放弃转而使用 Win + Down。而 Win + Down 也会带来问题，那就是在最大化时需要按两下快捷键，对于我这种懒人无疑是灾难性的。所以，写这个。\n\n功能如题。主要使用 `win32api` 的 `SetWindowsHookEx` , `WH_CBT` 完成。\n\n## 功能演示\n\n截图：\n\n![](./assets/screenshot.png)\n\n正常情况下最大化窗口：需要按两次 (Win + Down) 才能最小化\n\n![](./assets/normal.gif)\n\n开启 Hook 后，按住 `Shift` 最大化窗口：只需按一次 (Win + Down) 才能最小化\n\n![](./assets/hook.gif)\n\n## 项目结构\n\n```\n.\n└── Max4Min\n    ├── Max4Min                       # WPF 项目\n    ├── Max4MinCore                   # C++ / dll 项目\n    ├── Max4MinCoreConsoleTest        # 测试项目 可以忽略\n    ├── Max4MinCoreRuntimeHook        # dll 的 Wrapper\n    └── Max4MinCoreRuntimeUnHook      # 同上\n```\n\n之所以要做一层 Wrapper ，是因为：\n* 32 位的 dll 只能 hook 32 位的进程，64 位的 dll 只能 hook 64 位的进程\n* 32 位的 .NET 程序只能调用 32 位的 dll，64 位的 .NET 程序只能调用 64 位的 dll\n\n所以直接写了一层 Wrapper 封装成 exe 再进行调用。\n\n生成目录结构：\n\n```\n.\n├── ...\n├── Max4MinCore-x86.dll\n├── Max4MinCore-x64.dll\n├── Max4MinCoreRuntimeHook-x86.exe\n├── Max4MinCoreRuntimeHook-x64.exe\n├── Max4MinCoreRuntimeUnHook-x86.exe\n├── Max4MinCoreRuntimeUnHook-x64.exe\n└── \u003c.net target\u003e\n    ├── ...\n    └── Max4Min.exe\n```\n\n请执行 `\u003c.net target\u003e/Max4Min.exe` 来启动，其他都是支持文件。\n\n## 编译方法\n\n如果是 32 位系统，直接编译 x86 Target 即可。如果是 64 位系统，先编译 x86 Target (运行时可能报错，无所谓)，再编译 x64 Target（因为 64 位下也需要 Hook 32 位程序）。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffersonqin%2Fmax4min","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffersonqin%2Fmax4min","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffersonqin%2Fmax4min/lists"}