Results 1 to 14 of 14

Thread: window on top

  1. #1

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    window on top

    well i have made my application kept it on top using SetWindowPos, which works fine, but the problem is if i click the "Show Desktop" button it hides, is there ne way to disable that button until my application is runing

  2. #2
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Re: window on top

    In every window, when you click show dekstop button, all the running windows go to hide mode!

    Even if then program's window is always on top then, it will be hidden when "Show Desktop" button clicked!

    Why do you want this code?
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  3. #3
    Addicted Member Cimperiali's Avatar
    Join Date
    Oct 2002
    Location
    Milan, Italy, Europe
    Posts
    188

    Re: window on top

    You could probably intercept the message sent to your form, or track the
    user mouse input. But there is an easy workaround that could be enough for
    your purpouse:

    Btw: it seems as if, at least on my machine, the forms are not hided
    but minimized...
    Attached Files Attached Files
    Special thanks to some wonderful people,
    such as Lothar the Great Haensler, Aaron Young,
    dr_Michael, Chris Eastwood, TheOnlyOne ClearCode....

  4. #4

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Re: window on top

    hi
    well the code supplied doesn't work well at all, it sets the window on top but as i press the show desktop button it hides n remains hidden

  5. #5
    Addicted Member Cimperiali's Avatar
    Join Date
    Oct 2002
    Location
    Milan, Italy, Europe
    Posts
    188

    Re: window on top

    ...mmm... it does work on win2k....So DarkX_Greece is correct and form
    is hided, at least on your Os.
    Try change the code in timer event this way:
    Code:
    Private Sub TShow_Timer()
       If Me.WindowState = vbMinimized Then
          Me.WindowState = vbNormal
          Me.Caption = "done"
       End If
       If Me.Visible = False Then
          Me.Visible = True
       End If
    
    End Sub
    Special thanks to some wonderful people,
    such as Lothar the Great Haensler, Aaron Young,
    dr_Michael, Chris Eastwood, TheOnlyOne ClearCode....

  6. #6
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Re: window on top

    I told you that it doesn't work!

    Well, maybe there is a code that it will work, but for now, you can use Cimperiali's second way, by using Timer! There is the only way until find something else!
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  7. #7

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Re: window on top

    well i dunno about the code as i also have win2k advanced server, neva da less i got the idea that when the form gets minimized activate a timer to resize it to normal again ! thnkx for the tip

  8. #8
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Re: window on top

    Nice way hyousuf2!

    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: window on top

    Quote Originally Posted by hyousuf2
    ...i got the idea that when the form gets minimized activate a timer to resize it to normal again ! thnkx for the tip
    If that is what you want to do, you don't need a timer. Just add this
    VB Code:
    1. Private Sub Form_Resize()
    2. Me.WindowState = vbNormal
    3. End Sub

  10. #10
    Addicted Member Cimperiali's Avatar
    Join Date
    Oct 2002
    Location
    Milan, Italy, Europe
    Posts
    188

    Re: window on top

    Seems as if resize event of form does not trig when you hit the ShowDeskTop icon. That is why I disabled timer in that event: if it trigs, user minimized it,
    not the system...


    Quote Originally Posted by Hack
    If that is what you want to do, you don't need a timer. Just add this
    VB Code:
    1. Private Sub Form_Resize()
    2. Me.WindowState = vbNormal
    3. End Sub
    Special thanks to some wonderful people,
    such as Lothar the Great Haensler, Aaron Young,
    dr_Michael, Chris Eastwood, TheOnlyOne ClearCode....

  11. #11

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Re: window on top

    i totally agree, i tried da code myself n da same result, resize event doesn't trigger

  12. #12
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Re: window on top

    If you try this :
    VB Code:
    1. Private Sub Form_Resize()
    2. If Me.WindowState = vbMinimized Then
    3.       Me.WindowState = vbNormal
    4. End If
    5. End Sub

    the window will minimize if click the "Show Desktop" button, the only way is timer!

    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  13. #13
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: window on top

    Quote Originally Posted by DarkX_Greece
    the only way is timer!
    Just guessing, but another option might be subclassing and catching a hide or minimize message that is probably being sent.

    Why do you need your form visible at all times anyway?


    Has someone helped you? Then you can Rate their helpful post.

  14. #14
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Re: window on top

    It must be also an other way! I am very sure , because if you can see McAfee's VirusScan messages at the right-bottom of the user's screen and MSN Messenger's messages, then there sure a other way to do it!

    The only problem is to find this way!...
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

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