General information
Category:
Windows API functions
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only