Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find Window
Message
 
To
03/04/1998 15:45:21
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00089413
Message ID:
00090182
Views:
23
I had some c code that will do this:

// Try to find app window:
nSearchWindows = GetWindow(GetTopWindow(NULL),GW_HWNDFIRST); //Get first in the order
do {
if (GetWindowText(nSearchWindows,cWindowTitle,199) > 0){

if (memcmp("DataTrac",cWindowTitle,8) == 0){ // Found window
lWindowFound = TRUE;
break; // Exit do
}
}
nSearchWindows = GetWindow(nSearchWindows,GW_HWNDNEXT);
} while (nSearchWindows != NULL);

if (lWindowFound == TRUE){ // Found window.
SetForegroundWindow(nSearchWindows); // Set keyboard input to it
break;
}

Basically, it loops through all the windows looking for a window which starts with a string. You can convert it to VFP fairly easily.

--Shawn

>The FindWindowEx API function retrieves the handle of a window whose class name and window name match the specified strings. But I need to find a window with the partial name.
>
>Michel
Previous
Reply
Map
View

Click here to load this message in the networking platform