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
Printable View
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
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?
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...
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 :ehh:
...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
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!
:)
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 :wave:
Nice way hyousuf2!
:) :) :)
If that is what you want to do, you don't need a timer. Just add thisQuote:
Originally Posted by hyousuf2
VB Code:
Private Sub Form_Resize() Me.WindowState = vbNormal End Sub
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
i totally agree, i tried da code myself n da same result, resize event doesn't trigger
If you try this :
VB Code:
Private Sub Form_Resize() If Me.WindowState = vbMinimized Then Me.WindowState = vbNormal End If End Sub
the window will minimize if click the "Show Desktop" button, 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.Quote:
Originally Posted by DarkX_Greece
Why do you need your form visible at all times anyway?
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!...