Results 1 to 3 of 3

Thread: Always on top of an always on top form!

  1. #1
    Guest
    I'm trying to emualte the Workstation Lockout thingy that WinNT does.

    I've got 2 forms:

    The first one has no border and is the same colour as the desktop. It's been sized to fill the entire screen (masking off the crap behind it) and I've used "SetWindowPos" to make it stay on top of the taskbar etc.

    Now I have another form where someone enters a username and password in order to unlock the computer.

    My problem is that I need to make this second form stay on top of the first one (which is already always on top).

    I can't manage to do this reliably. Sometimes it works...others it doesn't work and cos I've also disabled ctrl+alt+del etc I have to reboot.

    I've tried just using SetWindowPos on the second form, I've tried messing with the OwnerForm argument when I show the second form modally...I've even tried using an MDI form for the background one but I can't get rid of its title bar.

    Any ideas how I can achieve this?

  2. #2
    Guest
    Show it as a modal form.
    Code:
    MyForm.Show vbModal

  3. #3
    Member
    Join Date
    Jul 2000
    Location
    BFE in Oregon
    Posts
    33

    Tested and Approved !

    You need to call the Password input form from the Always On Top form then set the Password form as Always On Top then (here's the key), set the Pasword form's ZOrder to 0(zero)

    Private Sub ShutoutForm_Click()
    PaswordForm.Show
    OnTop PasswordForm.hWnd, True 'OnTop is the sub to make the form stay on top
    PasswordForm.ZOrder 0 'This will put the form on top of all others that are OnTop
    End Sub

    One more note: During development, always leave yourself an exit, whether it be a key press or a specific location on your form that you can click to exit.

    [Edited by Glacius Cool on 08-30-2000 at 10:18 PM]
    Glacius Cool
    Concept Designer
    VB5sp4,VC++6sp3

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