>#DEFINE GW_HWNDLAST 1 >#DEFINE GW_HWNDNEXT 2 >#DEFINE GW_CHILD 5 > >DECLARE INTEGER GetDesktopWindow IN user32 >DECLARE INTEGER GetWindow IN user32 INTEGER hwnd, INTEGER wFlag >DECLARE INTEGER GetWindowText IN user32 INTEGER hwnd,; > STRING @lpString, INTEGER cch >DECLARE INTEGER GetClassName IN Win32Api INTEGER, STRING, INTEGER > >hWindow = GetDesktopWindow() >hWindow = GetWindow(hWindow,GW_CHILD) > >DO WHILE hWindow <> GetWindow(hWindow, GW_HWNDLAST) > hWindow = GetWindow(hWindow , GW_HWNDNEXT) > lcWinText =iGetWinText(hWindow) > hclass = SPACE(80) > nlen = getclassname(hWindow, @hclass, 80) > hclass = LEFT(ALLT(hclass),nlen) > > if "adobe"$LOWER(lcWinText) and hclass="#32770" > ?'ERROR' > exit > endif >ENDDO > > >RETURN >*--------------------------------------------------------------- >FUNCTION iGetWinText(hWindow) > LOCAL lnBufsize, lcBuffer > lnBufsize = 1024 > lcBuffer = Repli(Chr(0), lnBufsize) > lnBufsize = GetWindowText(hWindow, @lcBuffer, lnBufsize) >RETURN Iif(lnBufsize=0, "", Left(lcBuffer,lnBufsize)) > >>
>>.... if this is the first document then the following >>Declare Integer ShellExecute ; >> IN SHELL32.Dll ; >> INTEGER nWinHandle,; >> STRING cOperation,; >> STRING cFileName,; >> STRING cParameters,; >> STRING cDirectory,; >> INTEGER nShowWindow >> >>ShellExecute(0, "open", "acrord32.exe", " /p /h "+lcFile, "", 0) >>... >>...subsequent documents the following code >> >>ShellExecute(0,"print", lcFile,"","",0) >> >>>>