Skip to content

exp/shiny: windriver: AccessDenied for DestroyWindow #25671

Closed
@ktye

Description

@ktye

What version of Go are you using (go version)?

go version go1.9.2 windows/amd64

Does this issue reproduce with the latest release?

That should be the case.

What operating system and processor architecture are you using (go env)?

windows/amd64

What did you do?

Trying to close a window programmatically by sending a lifecycle event.
I'll send a comment with a link to an example program.

What did you expect to see?

The window to disappear.

What did you see instead?

For the main window this works, but client windows are not destroyed.

Description

This is a follow up to CL 115515.
It's a similar topic but an independent problem.

I tracked it down to shiny/driver/internal/win32/win32.go:121
Release calls DestroyWindow on the handle.
Adding a Printf shows that it returns AccessDenied.
I am not sure about the reason, it might be related to "running on the same thread".

Proposed fix

shiny/driver/internal/win32/win32.go:121
Replace _DestroyWindow(hwnd) with SendMessage(hwnd, _WM_CLOSE, 0, 0)
It works for me.

If you agree that this is the right fix, I'll send a CL.
Should I also remove the TODO's from @andlabs around it? I'm not sure if they are appropriate anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions