com >> Urgent: Form remains on top.

by dGVjaG5va25pZ2h0 » Fri, 10 Feb 2006 20:58:27 GMT

I am facing problem on a VB6 dll project.

What I have done:
I have made an application-1 which is a VB6 exe application. It adds a
floating toolbar (with one button on it) into powerpoint.

Then I have made a form in my application-2, which is a VB6 dll
application, and I am calling that form on the button click in the PowerPoint.
i.e. Floating Toolbar in PowerPoint -> On Click -> Calls form from VB6 dll
project.

Now, initially when I called the form it was appearing behind PowerPoint's
main window. Then I wrote this:

SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 1, 1, SWP_NOSIZE Or SWP_NOMOVE

on formload event. But, this gave me another problem. Now the form will
remain on top of every application that I open i.e. If my PPT is open and
then I open a word file the form will remain on top of word file too.

Then I tried:
SetWindowPos hWnd, HWND_TOP, 0, 0, 1, 1, SWP_NOSIZE Or SWP_NOMOVE

but then if I click PowerPoint then my form will go behind PowerPoint.




What I want:
The form should remain on top of PowerPoint window only. If I open another
application then the form should not be on top of that application. Also, I
want that till the time my form is open I should not be able to operate the
PowerPoint window, else if I click PowerPoint window the form will go behind
PowerPoint.

Just for example: I want to my form to show behaviour as shown by the "Save
PPT" window. If its open you should not be able to click on PowerPoint and my
form should be on top of Powerpoint only.

Please help me, this is very urgent.

Thanks in advance.


com >> Urgent: Form remains on top.

by Jan Hyde » Fri, 10 Feb 2006 21:24:25 GMT


technoknight < XXXX@XXXXX.COM >'s wild
thoughts were released on Fri, 10 Feb 2006 04:58:27 -0800
bearing the following fruit:


Does showing the form modally not do it?



Jan Hyde (VB MVP)

--
Apprenticeship: Hire learning (Leopold Fechtner)




com >> Urgent: Form remains on top.

by dGVjaG5va25pZ2h0 » Wed, 01 Mar 2006 17:04:27 GMT

Thanks for ur suggestion.

I don't how did I forget to show the form modally. Thanks for reminding me :).





Similar Threads

1. Dialogue form remains visible during program execution

My dialogue form (sometimes partly, sometimes as a whole)  remains visible
during a fairly long processing job.
The dialogue asks the user to enter some data for the job to follow, and
after OK, should disappear and the processing job (Sub CreateHTML()) starts,
while showing a progress bar in the main form.
The problem is that the dialogue form stays visible and does not close
during execution of the job. It closes after the job is finished.
What am I doing wrong? Should I start a separate thread for the processing
job, or is there a more simple solution I am not aware of yet? Code below:

        Dim fh As New frmHTML
        If fh.ShowDialog(Me) = DialogResult.OK Then
            'save dialogue data:
            '(not relevant I think, but left it in for clearity)
            DBDirectory = Directory.GetCurrentDirectory
            HLang = fh.cmbLanguage.Text
            HMainOnly = fh.radMain.Checked
            HVarCols = Val(fh.txtCols.Text)
            DBDirectory = fh.txtOutput.Text
            fh.Dispose() 'Get rid of the dialogue form (I thought......)
            ' do the processing job:
            CreateHTML()
        Else
            fh.Dispose()
        End if

Thank you for replying.
/Ger


2. Inheriting forms that won't remain static in .Net

3. Count remaining characters in a form field

I posted this over in the general area but it's more of a programming issue I 
think so I wanted to post it here as well.

Hi all,

I was wondering if it's possible to display the number of characters
remaining in a form field. I have a text field that is limited to 650
characters that a user can enter questions/ comments in. In another field I'd
like to keep a count of remaining characters because I wouldn't want the user
to manually keep track of 650 characters.

Is there a way to do this?

btw I'm using Word 2003 and while I have some programming experience, a
decent understanding of writing formulas in Excel and Access. I've never
tried doing this in Word before.

Thanks in advance for any help

4. Form that is not a top-level form cannot be displayed as a modal d - VB.Net

5. Center form class on top of main form

Hello all,

I'm calling a form class that just shows a status display of where the 
application is at .
I pass in text to display. I would like to keep that instance of the class 
form
centered in the main forms application if the user moves the main form?

thanks for you help
GV 


6. Display a modal form on top of a modeless form

7. form that always displayed on top of any forms

On Sat, 16 Aug 2003 17:59:19 +0530, "Rajan" < XXXX@XXXXX.COM >
wrote:

>I ant to display some importnt information that is updated with every
>transaction
>I want a form that always displayed on top of any forms/ dialoges shown
>in a MDI envoirnment
>
>Just like toolbars in Macromedia for setting properties
>
>Any solution
>
>thanks isn advance
>
>Rajan


Make your form a regular dialog (not a MDI Child, in other words) and
set the second param in the Show method for the form to your MDI form.
See the Show Method topic in your VB help file for more info.

HTH,
Bryan
____________________________________________________________
New Vision Software                   "When the going gets weird,"
Bryan Stafford		              "the weird turn pro."
alpine_don' XXXX@XXXXX.COM      Hunter S. Thompson -  
Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas

8. Form on top or form on task tray question - Visual Basic/VB