{"id":16645121,"url":"https://github.com/cosmo0920/windows-api","last_synced_at":"2025-10-28T18:06:04.569Z","repository":{"id":782930,"uuid":"475626","full_name":"cosmo0920/windows-api","owner":"cosmo0920","description":"A wrapper for win32-api that simplifies and automates common idioms","archived":false,"fork":false,"pushed_at":"2022-06-09T02:21:25.000Z","size":47,"stargazers_count":9,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T08:32:07.011Z","etag":null,"topics":["ruby","windows"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmo0920.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGES","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-01-17T01:22:23.000Z","updated_at":"2025-01-01T08:33:08.000Z","dependencies_parsed_at":"2022-07-05T14:31:28.622Z","dependency_job_id":null,"html_url":"https://github.com/cosmo0920/windows-api","commit_stats":null,"previous_names":["djberg96/windows-api"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmo0920%2Fwindows-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmo0920%2Fwindows-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmo0920%2Fwindows-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmo0920%2Fwindows-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmo0920","download_url":"https://codeload.github.com/cosmo0920/windows-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968213,"owners_count":19560585,"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":["ruby","windows"],"created_at":"2024-10-12T08:13:19.999Z","updated_at":"2025-10-28T18:05:59.505Z","avatar_url":"https://github.com/cosmo0920.png","language":"Ruby","readme":"== Description\n   This is a wrapper for Win32::API that simplifies various idioms typically\n   used by people who use Win32::API.\n\n== Synopsis\n   require 'windows/api'\n   include Windows\n   \n   # Defaults to 'V' prototype, 'L' return type and 'kernel32' library\n   GetVersion = API.new('GetVersion')\n   \n   # Defaults to 'L' return type and 'kernel32' library\n   CloseHandle = API.new('CloseHandle', 'L')\n   \n   # Defaults to 'kernel32' library\n   GetWindowsDirectory = API.new('GetWindowsDirectory', 'LI', 'I')\n   \n   # Explicitly state every argument\n   GetComputerNameEx = API.new('GetComputerNameEx', 'PPP', 'I', 'kernel32')\n   \n   # Use long data type names\n   GetUserName = API.new('GetUserName',['LPTSTR','LPDWORD'],'BOOL','advapi32')\n   \n   # Attributes for possible inspection\n   puts GetVersion.dll_name      # 'kernel32'\n   puts GetVersion.function_name # 'GetVersion'\n   puts GetVersion.prototype     # ['V']\n   puts GetVersion.return_type   # 'L'\n\n   # Automatic method generation\n\n   # This code....\n   module Windows\n     module Foo\n       API.auto_namespace = 'Windows::Foo'\n       API.auto_constant  = true\n       API.auto_method    = true\n       API.auto_unicode   = true\n         \n       API.new('GetComputerName', 'PP', 'B')\n     end\n   end\n\n   # Is the same as this code...\n   module Windows\n     module Foo\n       GetComputerName  = Win32API.new('kernel32', 'GetComputerName', 'PP', 'I')\n       GetComputerNameA = Win32API.new('kernel32', 'GetComputerNameA', 'PP', 'I')\n       GetComputerNameW = Win32API.new('kernel32', 'GetComputerNameW', 'PP', 'I')\n\n       def GetComputerName(p1, p2)\n         GetComputerName.call(p1, p2) != 0\n       end\n\n       def GetComputerNameA(p1, p2)\n         GetComputerName.call(p1, p2) != 0\n       end\n\n       def GetComputerNameW(p1, p2)\n         GetComputerName.call(p1, p2) != 0\n       end\n     end\n   end\n\n== Advantages over plain Win32::API\n   * Automatic constant generation.\n   * Automatic definition of ANSI and Unicode method wrappers, including\n     special handling for boolean methods.\n   * Ability to use more familiar Windows data types, e.g. DWORD.\n   * Automatic handling of msvcrt vs msvcrXX via MSVCRT_DLL constant.\n\n== Other Stuff\n   There's also a WideString class for easily creating wide strings for\n   Ruby 1.8.x. Ruby 1.9.x can use Ruby's encoding methods to accomplish\n   the same effect, however.\n\n== More documentation\n   See the RDoc documentation, which should have been automatically generated\n   if you installed this as a gem.\n\n== Future Plans\n   I have no future plans for this library other than bug fixes. You should\n   use FFI instead of win32-api for all projects where possible.\n\n== Bugs\n   None that I'm aware of. Please submit any bugs to the project page at\n   https://github.com/djberg96/windows-api.\n\n== Copyright\n   (C) 2007-2015, Daniel J. Berger\n   (C) 2016-2022, Hiroshi Hatake\n\n== License\n   Artistic 2.0\n\n== Author\n   Daniel Berger\n   Hiroshi Hatake","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmo0920%2Fwindows-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmo0920%2Fwindows-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmo0920%2Fwindows-api/lists"}