Skip to content

Instantly share code, notes, and snippets.

@yuka1984
Created September 26, 2015 04:28
Show Gist options
  • Select an option

  • Save yuka1984/e7e863b4aeb7eac7d576 to your computer and use it in GitHub Desktop.

Select an option

Save yuka1984/e7e863b4aeb7eac7d576 to your computer and use it in GitHub Desktop.
P/Invoke使わないで モニタハンドラを取得してみた ref: http://qiita.com/yu_ka1984/items/4a0439d421593c763fc4
var monitorfield = typeof(System.Windows.Forms.Screen).GetTypeInfo().DeclaredFields.Single(x => x.Name == "hmonitor");
var Screens = System.Windows.Forms.Screen.AllScreens.Select(x => new {
Screen = x,
hmonitor = (IntPtr)monitorfield.GetValue(x) });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment