[Pb] calls an external program in Pb and determines its operation is complete.

Source: Internet
Author: User

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"
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 () //
// wait until the dbbackup window is closed
do while iswindow (ll_handle)
yield ()
// application execution completed
MessageBox ("message", "backup completed! ")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.