func WndProc(hWnd winapi.HWND, message uint32, wParam uintptr, lParam uintptr) uintptr { // var hTemp winapi.HANDLE var pbHandled gohl.BOOL ret, handled := gohl.ProcNoDefault(uint32(hWnd), message, wParam, lParam) if handled { return uintptr(ret) } if pbHandled != 0 { //先把消息给HTMLayout return uintptr(ret) } switch message { case winapi.WM_CREATE: // gohl.LoadHtml(uint32(hWnd), []byte(html), "/") if err := gohl.LoadFile(uint32(hWnd), "a.html"); err != nil { println("LoadFile failed", err.Error()) } // hTemp, _ = winapi.LoadImageByName(0, "D:\\0004.bmp", // winapi.IMAGE_BITMAP, 0, 0, winapi.LR_LOADFROMFILE) // hBitmap = winapi.HBITMAP(hTemp) // case winapi.WM_PAINT: // OnPaint(hWnd) // case winapi.WM_DESTROY: // winapi.PostQuitMessage(0) // case winapi.WM_COMMAND: // OnCommand(hWnd, wParam, lParam) default: return winapi.DefWindowProc(hWnd, message, wParam, lParam) } return 0 }
func OnCommand(hWnd winapi.HWND, wParam uintptr, lParam uintptr) { // 暂时不需要特殊处理 WM_COMMAND winapi.DefWindowProc(hWnd, winapi.WM_COMMAND, wParam, lParam) }