{"id":23399983,"url":"https://github.com/bbigras/go-windows-session-notifications","last_synced_at":"2025-04-11T18:07:38.215Z","repository":{"id":11436739,"uuid":"13892312","full_name":"bbigras/go-windows-session-notifications","owner":"bbigras","description":"Receive session notifications on Windows","archived":false,"fork":false,"pushed_at":"2017-04-24T17:58:30.000Z","size":6,"stargazers_count":3,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T18:04:08.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bbigras.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-10-26T22:41:14.000Z","updated_at":"2023-02-23T09:14:27.000Z","dependencies_parsed_at":"2022-07-21T16:02:32.166Z","dependency_job_id":null,"html_url":"https://github.com/bbigras/go-windows-session-notifications","commit_stats":null,"previous_names":["brunoqc/go-windows-session-notifications"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbigras%2Fgo-windows-session-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbigras%2Fgo-windows-session-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbigras%2Fgo-windows-session-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbigras%2Fgo-windows-session-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbigras","download_url":"https://codeload.github.com/bbigras/go-windows-session-notifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456374,"owners_count":21106602,"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-12-22T10:18:10.064Z","updated_at":"2025-04-11T18:07:38.196Z","avatar_url":"https://github.com/bbigras.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-windows-session-notifications\n\nReceive session change notifications from Windows.\n\n## Sample code\n\n```go\npackage main\n\nimport (\n\t\"github.com/brunoqc/go-windows-session-notifications\"\n\t\"log\"\n)\n\nfunc main() {\n\tquit := make(chan int)\n\n\tchanges := make(chan int, 100)\n\tcloseChan := make(chan int)\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase c := \u003c-changes:\n\t\t\t\tswitch c {\n\t\t\t\tcase session_notifications.WTS_SESSION_LOCK:\n\t\t\t\t\tlog.Println(\"session locked\")\n\t\t\t\tcase session_notifications.WTS_SESSION_UNLOCK:\n\t\t\t\t\tlog.Println(\"session unlocked\")\n\t\t\t\t}\n\t\t\t\tclose(m.ChanOk)\n\t\t\t}\n\t\t}\n\t}()\n\n\tsession_notifications.Subscribe(changes, closeChan)\n\n\t// ctrl+c to quit\n\t\u003c-quit\n}\n```\n\n## Build with\n\n```bash\nset CGO_LDFLAGS=-lwtsapi32\n\n# with powershell\n$env:CGO_LDFLAGS=\"-lwtsapi32\";\n\ngo build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbigras%2Fgo-windows-session-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbigras%2Fgo-windows-session-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbigras%2Fgo-windows-session-notifications/lists"}