AnsweredAssumed Answered

vrf 'popping-up' the window, activate & setfocus

Question asked by paul.fowler on Oct 10, 2003

This one works for me.........

Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As Long)
As Long




                                                                                                                                             
                                                                                                                                             
                    "Andrew Fudge"          To:  "VEE vrf" <vrf@it.lists.it.agilent.com>                                                     
                    <AndrewF@genesysibs.c   cc:                                                                                              
                    om>                     Subject:  [vrf] RE: 'popping-up' the window, activate & setfocus                                 
                              10/10/03                                                                                                       
          15:00                                                                                                                              
                                                                                                                                             
          Please respond to "Andrew                                                                                                          
          Fudge"                                                                                                                             
                                                                                                                                             
          Stationery name:-Untitled-                                                                                                         
                                                                                                                                             
                                                                                                                                             
                                                                                                                                             
                                                                                                                                             
                                                                                                                                             



Hello all

I have just come across the requirement to activate a Application Window.
I
have tried many ways including API calls to
SetWindowPos/ShowWindow/BringWindowToTop and the example below.  On the web
I found the values for the constants on the below example but it doesn't
work.

Example of usage:
    A background (Visual Basic Compiled) app is running and while any other
window is active (eg Windows Internet Explorer) , I'd like the Visual Basic
App to activate itself, with visibility and focus.

Has anyone managed to do this successfully?

An example would be greatly appreciated.

Shawn, Are you able to offer more info?  I don't know if you looked this up
and assumed it would work.  I thought it would send the same message to the
app as if a user were to right-click the app in the Task Bar and click
"restore" in menu.


Many thanks

Andrew F
Genesys IBS
UK


----- Original Message -----
From: Shawn Fessenden <s_fessenden@hotmail.com>
To: VEE vrf <vrf@it.lists.it.agilent.com>
Sent: Saturday, March 15, 2003 4:16 PM
Subject: [vrf] RE: 'popping-up' the window


> Paul! You've jogged my brain!
>
> >The API call "User32.ShowWindow"
>
> After a little tracing, I found that ShowWindow *doesn't* post a
> WM_SYSCOMMAND, it posts a WM_SHOWWINDOW to the window. So then the best
way
> to do this would be:
>
> SendMessage(hVWnd, WM_SHOWWINDOW, SW_NORMAL, 0)
> -SHAWN-
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> ---
> You are currently subscribed to vrf as: AndrewF@genesysibs.com
> To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
> To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
> To send messages to this mailing list,  email
"vrf@it.lists.it.agilent.com".
> If you need help with the mailing list send a message to
"mailto:owner-vrf@it.lists.it.agilent.com.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 29/09/03


---
You are currently subscribed to vrf as: Paul.Fowler@raytheon.co.uk
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email
"vrf@it.lists.it.agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".





---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes