Window locking

Hi All

I installed my exe file of an application in autoexec.bat which pops up a login form after booting.My requirment is that user cant access any other applications until log in.

Can any body help me out.

regards

Atul




Answer this question

Window locking

  • Xiaobo Gu

    You can disable all the handles in the operating system except for all of your applications handles, then ask for the username and password. There is a few API's you have have to use. I'm not sure what it was to get the handles, but you use EnableWindow() to disable each handle.

    it went something like:

    for each (IntPtr ^handle in GetHandles()) // GetHandles isn't the correct name
    {
    if (Handle != this->Handle)
    {
    EnableWindow(1, Handle); // Disable the handle
    }
    }

    The only thing it doesn't do is disable the Windows Key or Start menu from coming up.  You can even hide the taskbar using the ShowWindow API.


  • JustinA1

    If you using XP-based operation system, try Microsoft Recovery Console, or booting in safe mode.

  • thinkfreeto

    I think you can make an screem saver program,if user want to get back to use other windows function,he has to enter username and password .



  • Shan McArthur

    Thanks for your comment.But that is not the solution of my problem.I just want to lock my window untile user enters his /her username and password and click on log in button.then and only then he can be able to access any other windows functionality.

  • ctsand

    Is there a good reason why you're not using built-in Windows security policy functions to do this That's what they're there for and they'll be a lot more reliable and easier to maintain than any kludge to work without them. It just seems like an odd requirement. Perhaps the requestor of this feature (someone not in an IT role ) isn't familiar with these features.



  • Window locking