Externally called in PbProgramAnd wait until the program is running.
If we want to back up the Adaptive Server Anywhere 6.0 database, after the backup is complete, it will show "The backup is complete! "Prompt information. If a message is displayed immediately after the backup program dbbackup is called with MessageBox, this will happen when the program is running: dbbackup backup is still running." backup is complete! The prompt is displayed, obviously not in line with our ideas. In this case, we can use the findwashwa (), iswindow (), and yield () functions of Pb.
declare an API function:
function long find0000wa (string lpclassname, string lpwindowname) library "user32.dll"
function Boolean iswindow (long hwnd) Library "user32.dll"
call:
ulong ll_handle
int li_loop
setpointer (hourglass !) // Set the mouse pointer
// run the backup database program dbbackup and minimize it
Run ("dbbackup-C ~ "Uid = DBA; Pwd = SQL; DBF = D:/Sybase/Adaptive Server Anywhere 6.0/asademo. DB ~ "D:/backup", minimized !)
ll_handle = 0
// open the do while ll_handle = 0
ll_handle = find=wa ("tty ", "dbbackup")
yield () //
loop
// wait until the dbbackup window is closed
do while iswindow (ll_handle)
yield ()
loop
// application execution completed
MessageBox ("message", "backup completed! ")