Create hello-platform for Windows #10

Open
kornerr wants to merge 46 commits from hrbmac into master
pull from: hrbmac
2 changed files with 3 additions and 4 deletions
Showing only changes of commit 806fc92e4a - Show all commits

No files matched your search

+2 -3
View File
@@ -1,7 +1,7 @@
import WinSDK import WinSDK
func otherSetupWindowIcons(_ iconId: Int) { func otherSetupWindowIcon(_ iconId: Int) {
// Only visit windows owned by this UI thread, never another application's window. // Only visit windows owned by this UI thread, never another application's window
EnumThreadWindows(GetCurrentThreadId(), { wnd, iconId in EnumThreadWindows(GetCurrentThreadId(), { wnd, iconId in
let resource = UnsafePointer<WCHAR>(bitPattern: Int(iconId)) let resource = UnsafePointer<WCHAR>(bitPattern: Int(iconId))
let module = GetModuleHandleW(nil) let module = GetModuleHandleW(nil)
@@ -30,7 +30,6 @@ func otherSetupWindowIcons(_ iconId: Int) {
SendMessageW(wnd, UINT(WM_SETICON), WPARAM(ICON_BIG), LPARAM(Int(bitPattern: large))) SendMessageW(wnd, UINT(WM_SETICON), WPARAM(ICON_BIG), LPARAM(Int(bitPattern: large)))
} }
// Shared resource icons remain valid for the lifetime of the process.
return true return true
}, LPARAM(iconId)) }, LPARAM(iconId))
} }
@@ -8,7 +8,7 @@ final class HPAppDelegate {
func setup() { func setup() {
otherSetupConsoleLogging(hp.ctrl, "HP") otherSetupConsoleLogging(hp.ctrl, "HP")
hp.setup() hp.setup()
otherSetupWindowIcons(101) otherSetupWindowIcon(101)
} }
} }