GetSystemMetrics()
GetSystemMetrics()
GetSystemMetrics()
int WINAPI GetSystemMetrics( __in intnIndex);

具体实现:

package main

import (
	"syscall"
	"fmt"
)

const (
	SM_CXSCREEN = uintptr(0)	// X Size of screen
	SM_CYSCREEN = uintptr(1) // Y Size of screen
)


func main(){
	
	w,_,_ := syscall.NewLazyDLL(`User32.dll`).NewProc(`GetSystemMetrics`).Call(SM_CXSCREEN)
	h,_,_ := syscall.NewLazyDLL(`User32.dll`).NewProc(`GetSystemMetrics`).Call(SM_CYSCREEN)

	fmt.Println(int(w),int(h))
}