Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Browse...
Message
From
10/10/2000 16:21:37
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00427361
Message ID:
00427538
Views:
14
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> ;)

>>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
>>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform