Closed TerryMarszr0 closed 5 years ago
By pressing the [X] button? Your question is a bit ambiguous.
i want to delay to destory the main window ,code as below ,but it looks like cant destory main window or break main window
go func() {
time.Sleep(30 * time.Second)
//hwnd := appWindow.GetHwnd()
hwdn := win.HWND(unsafe.Pointer(appWindow.GetHwnd()))
win.SendMessage(hwdn, win.WM_CLOSE, 0, 0)
//win.DestroyWindow(hwdn)
}()
You can't sleep in UI thread (and goroutine does not guarantee you that it will be run in a separate thread). Use timers.
TIScript:
self.timer(30*1000, function() { view.close(); });
thanks
how to close the main window