R romandooni New Member Jul 20, 2021 #1 hi This code is for disabling screenshots(c#) How to use it in b4j ? C#: using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsFormsApp2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("user32.dll")] public static extern uint SetWindowDisplayAffinity(IntPtr hwnd, uint dwAffinity); private void Form1_Load(object sender, EventArgs e) { const uint WDA_NONE = 0; const uint WDA_MONITOR = 1; SetWindowDisplayAffinity(this.Handle, WDA_MONITOR); } } }
hi This code is for disabling screenshots(c#) How to use it in b4j ? C#: using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsFormsApp2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("user32.dll")] public static extern uint SetWindowDisplayAffinity(IntPtr hwnd, uint dwAffinity); private void Form1_Load(object sender, EventArgs e) { const uint WDA_NONE = 0; const uint WDA_MONITOR = 1; SetWindowDisplayAffinity(this.Handle, WDA_MONITOR); } } }
Erel B4X founder Staff member Licensed User Longtime User Jul 20, 2021 #2 JNA is the best way to call native Windows methods. Unfortunately this method isn't available in JNA. Upvote 0
JNA is the best way to call native Windows methods. Unfortunately this method isn't available in JNA.