Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Activating the program in the Task bar
Message
From
02/10/2003 16:38:41
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
To
02/10/2003 03:50:06
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00834120
Message ID:
00834498
Views:
21
This message has been marked as the solution to the initial question of the thread.
This doesn't do everything you need, but prehaps it will get you started...

PARAMETERS cWindowName
*NOTE - The window name must be an exact match to the target window's title, but is not case sensitive.
*For example, if you have Outlook open and you are viewing the Inbox the
*title is "Inbox - Microsoft Outlook", otherwise this utility will not locate
*the appropriate window.

DECLARE Long FindWindow IN "user32" String, String
Declare Long SetActiveWindow IN "user32" Long
Declare Long SetForegroundWindow IN "user32" Long
strTemp=.null.
lngHandle=0
lngHandle = FindWindow(.null., cWindowName)
IF lngHandle>0
SetForegroundWindow(lngHandle)
SetActiveWindow(lngHandle)
ENDIF

>Hi Everyone,
>
>Anybody know how to set focus or activate the program that is already shown in the taskbar.
>
>Basically, what I wanted to do is that in my program, I have a button such that when the user presses it, it will bring up the Outlook. If the Outlook is already running, I don't wanted to run the 2nd instance of an Outlook. I just wanted to set the currently running Outlook window into maximize and set the current focus to Outlook as the currently selected program. And when he closes the Outlook, it will return the focus to my program.
L.A.Long
ProgRes
lalong1@charter.net
Previous
Reply
Map
View

Click here to load this message in the networking platform