Hi. I'm struggling to get this code to return a non-zero hwnd. I'm compiling w/ Go 1.18.3 Any help would be most appreciated.
package main import ( "fmt" w32a "github.com/JamesHovious/w32" w32 "github.com/gonutz/w32/v2" "runtime" const lastModified = "June 20, 2022" func main() { fmt.Printf("goclicksimple to use Go to activate a process so can be clicked on the screen. Last modified %s. Compiled by %s\n", lastModified, runtime.Version()) fmt.Printf(" Now to use w32.FindWindow\n") target := "*firefox*" hwnd := w32.FindWindow("MDIClient", target) fmt.Printf(" target=%q, MDIClient hwnd=%d\n", target, hwnd) hwnd = w32.FindWindow("", target) fmt.Printf(" target=%q, empty class hwnd=%d\n", target, hwnd) hwnd = w32.FindWindow("*", target) fmt.Printf(" target=%q, * hwnd=%d\n", target, hwnd) hwnd = w32.FindWindow("*lient*", target) // covers Client and client fmt.Printf(" target=%q, *lient* hwnd=%d\n", target, hwnd) var classString string hwnd2 := w32a.FindWindowS(&classString, &target) fmt.Printf(" w32a.FindWindowS empty class, target=%q, hwnd2=%v\n", target, hwnd2) classString = "*" hwnd2 = w32a.FindWindowS(&classString, &target) fmt.Printf(" w32a.FindWindowS '*' class, target=%q, hwnd2=%v\n", target, hwnd2) classString = "*lient*" hwnd2 = w32a.FindWindowS(&classString, &target) fmt.Printf(" w32a.FindWindowS '*lient*' class, target=%q, hwnd2=%v\n", target, hwnd2) classString = "*lass*" hwnd2 = w32a.FindWindowS(&classString, &target) fmt.Printf(" w32a.FindWindowS '*lass*' class, target=%q, hwnd2=%v\n", target, hwnd2) } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/7fcdfc94-2bff-4f87-8c3d-461fb67d32c9n%40googlegroups.com.