Show without activation.

H

h4xPace

Hi All,

What I am trying to do is display a form in the desktop foreground
without... at this is the critical part... stealing focus from the
active Window. I have tried:

Shadows ReadOnly Property ShowWithoutActivation() As Boolean
Get
Return False
End Get
End Property

No dice. Just some other points about the form... Its a borderless
form with a transparency key enabled, so basically the only thing that
the user should see is 'floating' text or an image. Perhaps there is a
better way to accomplish this? I am open to any and all suggestions.

Just to clear one thing up, if your solution is to set the forms
'TopMost' property to true then for petes sake save your keystrokes. I
have recieved that answer a number of times, and it is just a
irrelevant to the situation now as it was then.

I read on another forum that a guy accomplished this by using a
separate thread for the pop-up form, which I have not tried, though I
cant see how a new thread would help. Any direction on this would be
appreciated as well, since I would really rather not have to rewrite
to remove crossthread calls if I dont have to.

Thanks in advance,
-Chris
 
H

h4xPace

Hi All,

What I am trying to do is display a form in the desktop foreground
without... at this is the critical part... stealing focus from the
active Window. I have tried:

    Shadows ReadOnly Property ShowWithoutActivation() As Boolean
        Get
            Return False
        End Get
    End Property

No dice. Just some other points about the form... Its a borderless
form with a transparency key enabled, so basically the only thing that
the user should see is 'floating' text or an image. Perhaps there is a
better way to accomplish this? I am open to any and all suggestions.

Just to clear one thing up, if your solution is to set the forms
'TopMost' property to true then for petes sake save your keystrokes. I
have recieved that answer a number of times, and it is just a
irrelevant to the situation now as it was then.

I read on another forum that a guy accomplished this by using a
separate thread for the pop-up form, which I have not tried, though I
cant see how a new thread would help. Any direction on this would be
appreciated as well, since I would really rather not have to rewrite
to remove crossthread calls if I dont have to.

Thanks in advance,
-Chris


++++++++++ That shadowed property is actually set to return true, I
just had it false for the debug session that I was working with. It
does not work either way, sorry for the confusion ++++++++++++++
 
C

Cor Ligthert[MVP]

Hi

I am really breaking my head, what you mean with this one
What I am trying to do is display a form in the desktop foreground
without... at this is the critical part... stealing focus from the
active Window. I have tried:

Cor
 
C

Cor Ligthert[MVP]

Sorry,

I think I got it, you want to make a notification on screen, but let the
current focused screen keep the activated screen.

But now the solution.

Cor
 
B

Bill McCarthy

Hi Chris,

I did this in the VB Snipept editor, but it did actually get activated but
then reactivates the parent.

See the "Create Shapely Forms" part of this article I wrote :
http://visualstudiomagazine.com/columns/article.aspx?editorialsid=2086



Protected Overrides Sub DefWndProc( _
ByRef m As System.Windows.Forms.Message)

MyBase.DefWndProc(m)
Const WM_NCACTIVATE As Int32 = &H86

If Me.m_Owner IsNot Nothing AndAlso _
m.Msg = WM_NCACTIVATE Then

SendMessage(m_Owner.Handle, _
m.Msg, New IntPtr(1), IntPtr.Zero)
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top