//go:build windows

package main

import (
	"fmt"
	"os"
	"path/filepath"
	"syscall"
	"unsafe"
)

func showLockedMediaHint() {
	runner := filepath.Base(os.Args[0])
	if m := readManifest(); m != nil && m.RunnerDisplay != "" {
		runner = m.RunnerDisplay
	}
	if runner == "" {
		runner = "the runner .exe"
	}
	msg := fmt.Sprintf("This movie is locked.\r\n\r\nUse with:\r\n%s", runner)
	title := "Locked media"
	user32 := syscall.NewLazyDLL("user32.dll")
	messageBoxW := user32.NewProc("MessageBoxW")
	messageBoxW.Call(
		0,
		uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(msg))),
		uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(title))),
		0x30,
	)
}
