Results 1 to 4 of 4

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

  1. #1
    Guest

    Wink

    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
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Form2.Show vbModal
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Guest
    Not reliable.

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Make sure the first background form is painted on the screen and the call to SetWindowsPos is done before loading the second form. Then call SetWindowsPos in the Form_Paint event of that form. (You can't have AutoRedraw set to True though)

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