Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Browse...
Message
From
10/10/2000 16:24:34
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00427361
Message ID:
00427541
Views:
11
>Hi, Ed!
>
> WinExec can only run application when ShellExecute allows to do many other things. Though WinExec is more simple in use. And I never thought it is obsolete function. Maybe my Win32API.HLP file is obslete? <g> ;)
>

It is. The following is cut from the MSDN Library docs:
WinExec
The WinExec function runs the specified application.

Note This function is provided only for compatibility with 16-bit Windows. Win32-based applications should use the CreateProcess function.


>>>Hi, Nadya!
>>>
>>> Read events in TableMaintenance application have no effect if you already have read events in main application. Just because both run in the instance of the same VFP process. When you want to run TableMaintenance correctly, you will need to make starting form in it as modal form. If you cannot edit that application, you can also try to run it as external windows application, if it is possible for you.
>>> Check if aplication is still in memory until it runs. When it finished to run - continue your program. You may do all this using API functions:
>>>
>>>FindWindow - to check that some window still exists
>>>Sleep - to wait some time in loop that checks above
>>>WinExec - to run TableMaintenance as eternal application
>>>
>>>Following is sample:
>>>
>>>
>>>IF WinExec(lcPath + "TableMaintenance.EXE", 1) > 31		&& running exe successfully
>>
>>* WinExec is only there for backwards compatibility - use ShellExecute()
>>* or CreateProcess() instead.
>>
>>
>>>  DO WHILE !glShutdown && check for shutdown flag - application should be always closable
>>>    sleep(100)
>>>    IF FindWindow(0, @lcMyWindowCaption) = 0 && no more such window
>>>      EXIT
>>>    ENDIF
>>>  ENDDO
>>>ENDIF
>>>
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform