mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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:
+7
-1
@@ -132,13 +132,19 @@ func initResources() error {
|
|||||||
}
|
}
|
||||||
resources.cursor = c
|
resources.cursor = c
|
||||||
icon, _ := windows.LoadImage(hInst, iconID, windows.IMAGE_ICON, 0, 0, windows.LR_DEFAULTSIZE|windows.LR_SHARED)
|
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{
|
wcls := windows.WndClassEx{
|
||||||
CbSize: uint32(unsafe.Sizeof(windows.WndClassEx{})),
|
CbSize: uint32(unsafe.Sizeof(windows.WndClassEx{})),
|
||||||
Style: windows.CS_HREDRAW | windows.CS_VREDRAW | windows.CS_OWNDC,
|
Style: windows.CS_HREDRAW | windows.CS_VREDRAW | windows.CS_OWNDC,
|
||||||
LpfnWndProc: syscall.NewCallback(windowProc),
|
LpfnWndProc: syscall.NewCallback(windowProc),
|
||||||
HInstance: hInst,
|
HInstance: hInst,
|
||||||
HIcon: icon,
|
HIcon: icon,
|
||||||
LpszClassName: syscall.StringToUTF16Ptr("GioWindow"),
|
LpszClassName: appid,
|
||||||
}
|
}
|
||||||
cls, err := windows.RegisterClassEx(&wcls)
|
cls, err := windows.RegisterClassEx(&wcls)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user