Results 1 to 6 of 6

Thread: works when ran uncompiled, but not in compiled state!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Posts
    17
    I have an app i am making that is supposed to make itself small and dock in the upper right of the screen, its supposed to bring itself tot he top every 500 milsec by using

    form1.zorder

    now this works when I test it running in visual basic itself, but once I make it into an exe it doesnt come to the top AT ALL!!!! please help!!

  2. #2
    Guest
    What OS are you using/targeting ?

    -john

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Posts
    17
    win 9x primarily. Eventually i hope to make a win2k and me version

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    With ZOrder you put your form at the top or bottom of the forms of your application.
    It seems to me you want to keep your form as the topmost window systemwide. To do this use the API function SetWindowPos with HWND_TOPMOST as parameter. Search this forum for examples. There must be plenty. If you don't find them tell me, and I will post one.

  5. #5
    Member
    Join Date
    Aug 1999
    Location
    Houston
    Posts
    48
    Maybe the form is there, but not on "top". Try the following.

    Add the following code to a .bas file in the project. (A new .bas file can be added by selecting a new "module". Make sure you right click on the new module and "save as" into the working directory.)

    Public Const HWND_TOPMOST = -1
    Public Const HWND_NOTOPMOST = -2

    Declare Function SetWindowPos Lib "USER32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

    When you want, for example, Form1 visible and on top of all screens, use the following code

    success% = SetWindowPos(Form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, flags)

    When you want Form1. on the bottom, use

    success% = SetWindowPos(Form1.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, flags)


    -lp

  6. #6
    Guest
    The reason I asked about your OS

    I think I read somewhere that under 95/nt4 SetWindowPos will bring the window to the top, but under win 98/nt5 it will just flash on the task bar. Is this true? (i haven't tried it)

    [Edited by RoyceWindsor1 on 05-15-2000 at 10:20 AM]

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