app: [Windows] use the app ID for the window class registry

We're about to send messages between multiple instances of the same
program, and we need something to distinguish Gio programs. Use the
app ID.

Signed-off-by: inkeliz <inkeliz@inkeliz.com>
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
inkeliz
2024-06-10 20:49:02 +01:00
committed by Elias Naur
parent 818061a18a
commit f48cc2c47f
+7 -1
View File
@@ -132,13 +132,19 @@ func initResources() error {
}
resources.cursor = c
icon, _ := windows.LoadImage(hInst, iconID, windows.IMAGE_ICON, 0, 0, windows.LR_DEFAULTSIZE|windows.LR_SHARED)
appid, err := syscall.UTF16PtrFromString(ID)
if err != nil {
return err
}
wcls := windows.WndClassEx{
CbSize: uint32(unsafe.Sizeof(windows.WndClassEx{})),
Style: windows.CS_HREDRAW | windows.CS_VREDRAW | windows.CS_OWNDC,
LpfnWndProc: syscall.NewCallback(windowProc),
HInstance: hInst,
HIcon: icon,
LpszClassName: syscall.StringToUTF16Ptr("GioWindow"),
LpszClassName: appid,
}
cls, err := windows.RegisterClassEx(&wcls)
if err != nil {