win
win copied to clipboard
How to kill HWND ?
hwnd := win.FindWindow(nil, syscall.StringToUTF16Ptr("someApp"))
// I want to kill hwnd, how?
Have you tried
win.SendMessage(hwnd, win.WM_CLOSE, 0, 0)
?
It might be prudent to use the non-blocking variant
win.PostMessage(yourHWND, win.WM_CLOSE, 0, 0)
The program you are trying to close might open a popup dialog (e.g. requesting to save the modified document it was showing) and that will block your program!