CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2014
    Posts
    2

    Stop window snap for form in visual basic 2013 prevent user form leaving form etc

    Windows Areo, I think, enabled you to be able to take a window/form and drag it to the top of the screen to make it "full screen" and to drag it to the side to make it "half screen". I have a form with an "Accept" and a "Decline" button on it. When it starts it is maximized at full screen and it covers everything. The Minimize/Maximize buttons are disabled. So is the "X" button for closing the program.

    The program I am writing is meant to disable use of the PC until the user agrees to the "rules of use" for the PC which are written on the form.

    I am using Vb 2013 and currently the program will be used on Windows 7 or above, but it may get used at some point in time on an old PC using XP or Vista.

    My intention is that the user can do NOTHING anywhere in the system, they can't start a program, they can't use the "tab" to switch windows, nothing until they either click "Accept" or "Decline". If they click decline the system is to log them off and restart or shutdown or something like that. If they click accept then the form changes from maximized to normal and it no longer is forced to be the focus or the "topmost" and they can now run other programs and use the PC normally.

    The problem I am having is that I can't seem to find a way to disable the Windows "Snap" feature. If I click in the forms title bar and drag the form it will resize to "normal" and will no longer fill the screen. This will let the user do other things and I need to stop that until the user clicks Accept.

    How do I disable or 100% prevent a user from doing ANYTHING until they click "Accept" or "Decline"

    Thanks to anyone who can suggest a way to disable the "Snap" or prevent the user from doing anything except click one of the two buttons.

    Ralph

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Stop window snap for form in visual basic 2013 prevent user form leaving form etc

    You aren't going to prevent the user from pressing CTRL + ATL + DEL to bypass your program. If you wanted functionality like what you are asking, it used to be that you would write a custom GINA dll to interrupt the logon progress and start your program. Do a search for Gina dll in bing or google (not sure if the process is the same for Win 7 and above).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured