Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More fun with API's!
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00052880
Message ID:
00052893
Views:
30
>I think an API reference book is what I need. Can someone suggest a
>good one? Well, while I'm waiting for that, (1) what API functions can I
>use to bring a particular Win95 app (window) to the front, and (2) what API
>functions can I use to release a win95 app (window)?
>
>Any help in using these functions would also be appreciated. I've never
>had to use this type of API stuff. As I look over VFP's sketchy docs I
>am having nightmare flashbacks of my C programming days....

Michael,

The ShowWindow() function, as I mentioned in an earlier message, will provide the answer to part 1. Here's the declare:

DECLARE INTEGER ShowWindow IN Win32API;
INTEGER hwnd, INTEGER nCmdShow

hwnd is the window handle. Here are the declares for the value of nCmdShow:

#define SW_HIDE 0
#define SW_NORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_SHOWMAXIMIZED 3
#define SW_SHOWNOACTIVATE 4
#define SW_SHOW 5
#define SW_MINIMIZE 6
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9
#define SW_SHOWDEFAULT 10

As for part two, you'd have to start the app with CreateProcess (you couldn't use run or WinExec) in order to end it with TerminateProcess. I've never tried this so I don't know all the ins and outs. I do know that you have to use at least one other API call, GetExitCodeProcess to do this. It might be a lot easier to use the application's macro language (if it has one) to tell it to exit.

George
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform