Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Block Input only works from Visual Sudio

$
0
0

I'm writing an application that blocks user input until something is done in an application that launches as soon as user logs on.

I'm using the BlockInput (PInvoke) to block keyboard and mouse,  below:

[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "BlockInput")]
        [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
        public static extern bool BlockInput([System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] bool fBlockIt);
When I launch the application from Visual Studio it works fine, but when the app launches automatically after logon, it doesn't block anything.  I figure that the OS is preventing this, but I'm not sure.  Any ideas??

NR


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>