Results 1 to 6 of 6

Thread: SHOULD be an easy fix...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    7

    Talking


    I'm having a problem with a SIMPLE proceedure...
    The API documentation I've found states...

    "HWND_TOPMOST = -1
    Make the window topmost (above all other windows)
    permanently."

    ...And in all the post I've read, this argument
    seems to work when calling SetWindowPos to keep my
    Main Form Always on Top.

    I've placed the call in my Form_Load, and it doesn't
    work. It begins initially on top, but NOT permanently,
    ther widows are allowed to be placed over it. I have even
    ncluded the flag... SWP_NOZORDER so as not change the
    indow's position in the Z-order.

    What am I missing?

    -Serp



  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    take a look at the second half of this page..

    http://www.vb-world.net/tips/tip4.html


    Mark
    -------------------

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    7

    No Error


    I've done that and get a return value of 1. No error.
    Not on top permanently.


    Dim errr As Long
    errr = SetWindowPos (Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
    'errr = 1


    ?

    -Serp

  4. #4
    Lively Member
    Join Date
    Apr 2000
    Location
    Hell
    Posts
    89
    >> I've placed the call in my Form_Load, and it doesn't
    work. It begins initially on top, but NOT permanently,
    ther widows are allowed to be placed over it. I have even
    ncluded the flag... SWP_NOZORDER so as not change the
    indow's position in the Z-order.

    Uhm, dood... that's messed up. You're trying to fix the window at the top of the Z-Order (HWND_TOPMOST), but then you specify to ignore the Z-Order parameter (SWP_NOZORDER).

    - Steve

    Real programmers use COPY CON PROGRAM.EXE

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    7
    I was under the impression that the flag swp_nozorder kept
    the window at the top of the Z-order...

    ...and therefore kept it at the top...?

    "SWP_NOZORDER = &H4
    Do not change the window's position in the Z-order. "
    - http://www.vbapi.com/ref/s/setwindowpos.html

    -Serp

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    7


    ...But you are right, it is a flag to ignore
    the Z-order thus counteracting everything I was trying
    to do. (And ruining my Master plan to take over the World!)

    result = InsertLaugh LAUGH_LONG, 0, LAUGH_EVIL, EVIL_FLAGS

    Thanks for the clarification!

    -Serp



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