Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/20/2014 in all areas

  1. RTFC

    Code Scanner

    Hi Everyone, This is my first-ever post to this forum, and it's also the first forum I ever joined, after visiting anonymously for some time. I've been very impressed by both the level of expertise and the friendly, helpful, generous, and funny replies to OPs by the large majority of members. My main intention in joining was to share some potentially useful scripts of mine with the community. I've been programming for many years, and since a few months, also in AutoIt. On the other hand, I've no clue about posting stuff, so here goes (fingers crossed): I wrote this one to help solve dependency issues in some larger AutoIt projects of mine, but it should be equally useful for small/simple projects. It's not meant to replace AU3check, but to provide additional info on your project, and identify *possible* runtime issues that the compiler does not pick up. You then have to figure out yourself whether/where/how to change your code. Also be warned that the file I/O is tectonically slow (definitely room for improvement there). Download CodeScanner and associated UDFs in the CodeScannerCrypterBundle. This utility scans an AutoIt code project with multiple #includes and/or UDFs for inconsistencies, clashes, and various other hidden (potential) problems. It also generates MetaCode files for use with CodeCrypter and the MCf library. It does NOT alter your code; it just reads, evaluates, and reports. 36 Optional Outputs (from version 2.0😞 status report (text file), identifying: missing #includes, duplicate UDFs (lists all occurrences with their resp. parameters); issues with global definitions, unresolved function parameters... searchable treeviews of code architecture (nested #includes, nested function calls (UDF + native AUtoIt); detailed stats for each selected branch (who calls X, who is called by X) array listings (some 2-D) of: identified potential issues; unique #includes, redundant #includes; unique UDFs with calling stats; globals; all locations/definitions of UDF func def/endfunc, all calls, all #includes, all globals, all variables, all literal strings, all native AutoIt functions (with parameters) definition list of all globals identified only within UDFs, written out as script for easy inclusion at top of your script (so all globals are predefined in main code) MetaCode files (see the MetaCode thread (esp. the Tutorial) for details: '?do=embed' frameborder='0' data-embedContent>>) all results can be written to text files and read in to other scripts in their original array formats with an additionally supplied small UDF. You can edit the code to add more yourself; I'm gradually extending its functionality as/when required for my own projects. Hope it helps!
    1 point
  2. So I think it's time to publish this little tutorial I have made on using DllCall() and DllStructs. It's not near completion but I think it's a good start at least This tutorial is mostly aimed for people who have never used DllCall() before or have very limited knowledge about it. In the future I will update it with more advanced topics so more advanced users can make use of it too. Well here goes. Dealing_with_Dll.pdf Previous downloads: 31 Suggestions, language corrections and errors in the tutorial is of course welcome.
    1 point
  3. water

    Active Directory UDF

    I have converted and extended the adfunctions.au3 written by Jonathan Clelland to a full AutoIt UDF including help file, examples, ScITE integration etc. The example scripts should run fine without changes. 2016-08-18: Version: 1.4.6.0 As always: Please test before using in production! KNOWN BUGS: (Last changed: ) None AD 1.4.6.0.zip For AutoIt >= 3.3.12.0 AD 1.4.0.0.zip other versions of AutoIt
    1 point
  4. Lupo73

    AutoComplete Input Text

    I found different solutions to do it and I finally decided to merge them in a single "optimal" code. During the typing it checks each new word (from the previous whitespace to the current pointer) and proposes to complete it with words included in a array. Predicted words are shown in a list under the input field and can be selected with mouse or with up/down/enter keys. These are the sources considered to create this code: '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> And this is the code: #include <GUIConstantsEx.au3> #include <WinAPI.au3> #Include <GuiListBox.au3> #include <WindowsConstants.au3> Global $asKeyWords[21] = [20, "fight", "first", "fly", "third", "fire", "wall", "hi", "hello", "world", "window", _ "window 1", "window 2", "window 3", "window 4", "window 5", "window 6", "window 7", "window 8", "window 9", "window 10"] _Main() Func _Main() Local $hGUI, $hList, $hInput, $aSelected, $sChosen, $hUP, $hDOWN, $hENTER, $hESC Local $sCurrInput = "", $aCurrSelected[2] = [-1, -1], $iCurrIndex = -1, $hListGUI = -1 $hGUI = GUICreate("AutoComplete Input Text", 300, 100) GUICtrlCreateLabel('Start to type words like "window" or "fire" to test it:', 10, 10, 280, 20) $hInput = GUICtrlCreateInput("", 10, 40, 280, 20) GUISetState(@SW_SHOW, $hGUI) $hUP = GUICtrlCreateDummy() $hDOWN = GUICtrlCreateDummy() $hENTER = GUICtrlCreateDummy() $hESC = GUICtrlCreateDummy() Dim $AccelKeys[4][2] = [["{UP}", $hUP], ["{DOWN}", $hDOWN], ["{ENTER}", $hENTER], ["{ESC}", $hESC]] GUISetAccelerators($AccelKeys) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hESC If $hListGUI <> -1 Then ; List is visible. GUIDelete($hListGUI) $hListGUI = -1 Else ExitLoop EndIf Case $hUP If $hListGUI <> -1 Then ; List is visible. $iCurrIndex -= 1 If $iCurrIndex < 0 Then $iCurrIndex = 0 EndIf _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hDOWN If $hListGUI <> -1 Then ; List is visible. $iCurrIndex += 1 If $iCurrIndex > _GUICtrlListBox_GetCount($hList) - 1 Then $iCurrIndex = _GUICtrlListBox_GetCount($hList) - 1 EndIf _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hENTER If $hListGUI <> -1 And $iCurrIndex <> -1 Then ; List is visible and a item is selected. $sChosen = _GUICtrlListBox_GetText($hList, $iCurrIndex) EndIf Case $hList $sChosen = GUICtrlRead($hList) EndSwitch Sleep(10) $aSelected = _GetSelectionPointers($hInput) If GUICtrlRead($hInput) <> $sCurrInput Or $aSelected[1] <> $aCurrSelected[1] Then ; Input content or pointer are changed. $sCurrInput = GUICtrlRead($hInput) $aCurrSelected = $aSelected ; Get pointers of the string to replace. $iCurrIndex = -1 If $hListGUI <> -1 Then ; List is visible. GUIDelete($hListGUI) $hListGUI = -1 EndIf $hList = _PopupSelector($hGUI, $hListGUI, _CheckInputText($sCurrInput, $aCurrSelected)) ; ByRef $hListGUI, $aCurrSelected. EndIf If $sChosen <> "" Then GUICtrlSendMsg($hInput, 0x00B1, $aCurrSelected[0], $aCurrSelected[1]) ; $EM_SETSEL. _InsertText($hInput, $sChosen) $sCurrInput = GUICtrlRead($hInput) GUIDelete($hListGUI) $hListGUI = -1 $sChosen = "" EndIf WEnd GUIDelete($hGUI) EndFunc ;==>_Main Func _CheckInputText($sCurrInput, ByRef $aSelected) Local $sPartialData = "" If (IsArray($aSelected)) And ($aSelected[0] <= $aSelected[1]) Then Local $aSplit = StringSplit(StringLeft($sCurrInput, $aSelected[0]), " ") $aSelected[0] -= StringLen($aSplit[$aSplit[0]]) If $aSplit[$aSplit[0]] <> "" Then For $A = 1 To $asKeyWords[0] If StringLeft($asKeyWords[$A], StringLen($aSplit[$aSplit[0]])) = $aSplit[$aSplit[0]] And $asKeyWords[$A] <> $aSplit[$aSplit[0]] Then $sPartialData &= $asKeyWords[$A] & "|" EndIf Next EndIf EndIf Return $sPartialData EndFunc ;==>_CheckInputText Func _PopupSelector($hMainGUI, ByRef $hListGUI, $sCurr_List) Local $hList = -1 If $sCurr_List = "" Then Return $hList EndIf $hListGUI = GUICreate("", 280, 160, 10, 62, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_MDICHILD), $hMainGUI) $hList = GUICtrlCreateList("", 0, 0, 280, 150, BitOR(0x00100000, 0x00200000)) GUICtrlSetData($hList, $sCurr_List) GUISetControlsVisible($hListGUI) ; To Make Control Visible And Window Invisible. GUISetState(@SW_SHOWNOACTIVATE, $hListGUI) Return $hList EndFunc ;==>_PopupSelector Func _InsertText(ByRef $hEdit, $sString) #cs Description: Insert A Text In A Control. Returns: Nothing #ce Local $aSelected = _GetSelectionPointers($hEdit) GUICtrlSetData($hEdit, StringLeft(GUICtrlRead($hEdit), $aSelected[0]) & $sString & StringTrimLeft(GUICtrlRead($hEdit), $aSelected[1])) Local $iCursorPlace = StringLen(StringLeft(GUICtrlRead($hEdit), $aSelected[0]) & $sString) GUICtrlSendMsg($hEdit, 0x00B1, $iCursorPlace, $iCursorPlace) ; $EM_SETSEL. EndFunc ;==>_InsertText Func _GetSelectionPointers($hEdit) Local $aReturn[2] = [0, 0] Local $aSelected = GUICtrlRecvMsg($hEdit, 0x00B0) ; $EM_GETSEL. If IsArray($aSelected) Then $aReturn[0] = $aSelected[0] $aReturn[1] = $aSelected[1] EndIf Return $aReturn EndFunc ;==>_GetSelectionPointers Func GUISetControlsVisible($hWnd) ; By Melba23. Local $aControlGetPos = 0, $hCreateRect = 0, $hRectRgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) Local $iLastControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle(-1)) For $i = 3 To $iLastControlID $aControlGetPos = ControlGetPos($hWnd, '', $i) If IsArray($aControlGetPos) = 0 Then ContinueLoop $hCreateRect = _WinAPI_CreateRectRgn($aControlGetPos[0], $aControlGetPos[1], $aControlGetPos[0] + $aControlGetPos[2], $aControlGetPos[1] + $aControlGetPos[3]) _WinAPI_CombineRgn($hRectRgn, $hCreateRect, $hRectRgn, 2) _WinAPI_DeleteObject($hCreateRect) Next _WinAPI_SetWindowRgn($hWnd, $hRectRgn, True) _WinAPI_DeleteObject($hRectRgn) EndFunc ;==>GUISetControlsVisible Any advice to improve the code is welcome.
    1 point
  5. #include <MsgBoxConstants.au3> ; Terminates script if no command-line arguments If $CmdLine[0] = 0 Then Exit ; Alternative: If $CmdLine[0] = 0 Then Exit EndIf MsgBox($MB_SYSTEMMODAL, "", "Script has command-line arguments.")
    1 point
  6. My condolences to you. May Allah rest his soul. Br, UEZ
    1 point
  7. KstGamesandsoftwares, Starstar is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. M23
    1 point
  8. When using Windows Vista and above, there is no XP style progress bar in the standard Window's API, you have to roll your own.
    1 point
  9. #include <MsgBoxConstants.au3> MsgBox($MB_SYSTEMMODAL, "Prompt for Chrome automation", "Read post 1 example 5", 10)
    1 point
  10. AntraX: Por favor, no secuestrar tema de otra persona. Crea tu propio hilo para que podamos ayudarle en su pregunta, sin quitar de la pregunta de helebek.
    1 point
  11. $Ticket = InputBox("", "Test") If @error = 1 Then ;Do stuff EndIf
    1 point
  12. Have you tried doing a silent install or using a response file? I have several auto installers that use both.
    1 point
  13. How about a little more explanation, such as why you feel the need to mix languages? Or what you are trying to accomplish on Tweepi? Help us help you.
    1 point
  14. Before the including the script with constants(ie StaticConstants.au3) the function is executed, hence it shows the error. - As it says as Autoit Starts Execute the function "Main" The following way of inserting the includes isn't recommended but would make you understand better. #OnAutoItStartRegister "main" AutoItSetOption('MustDeclareVars', 1) Global $hForm ;main() Func main() #Include <StaticConstants.au3> #Include <GUIConstantsEx.au3> ;The variable hForm is also not declared MsgBox(64, "Info", "IsDeclared(""hForm"")? " & IsDeclared("hForm") & @CRLF & "0 stands for not declared") ; -1 stands for local variable $hForm = GUICreate('', 397, 339) ;it is now declared by default as local due to the assignment. MsgBox(64, "Info", "IsDeclared(""hForm"")? " & IsDeclared("hForm") & @CRLF & "-1 stands for local variable") ; -1 stands for local variable GUICtrlCreateLabel('Test', 20, 20, 60, 21, $SS_CENTERIMAGE) GUISetState(@SW_SHOW, $hForm) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch Wend EndFunc Hope you understand from the example, ask if further queries are present. Regards
    1 point
  15. I was reading your thread earlier but I'm a big dll noob myself, and the minute I saw this thread I knew you had dug it up lol! Anyways, just wanted to say thanks as well! Some juicy stuff in here
    1 point
  16. With a small modification you can replace the bitmap background with a solid color easily and the way I play the animation is only an example. In real environment you will do it probably slightly different. Without seeing your code I cannot say how to exit the animation. If you used the same way I have used then just have a look to the $GUI_EVENT_CLOSE section. Btw, removing If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) from the loop may cause a memory leak! Br, UEZ
    1 point
  17. Hi, monoceres made a> tutorial some time ago. Saludos
    1 point
  18. FireFox

    Reading letter bytes

    Hi, Maybe... $s = FileRead("in.txt") $s2 = StringRegExpReplace($s, "\W", " ") FileWrite("out.txt", $s2) _ Br, FireFox.
    1 point
  19. I said inane. EDIT: Yes, that's what that translates to.
    1 point
  20. Werty

    Turning ON/OFF webcam LED

    For personal use a small piece of black electrical tape work wonders.
    1 point
  21. I just started this UDF. Any suggestions, critiques, geek-slaps, or improvements are VERY welcome and requested! This is VERY helpful for me! In lots of different ways! I just wanted to share. In the tech docs for the AICAPI, there is explanation on controlling the buttons and so forth in Acrobat and even using it to embed it in a GUI. UPDATE HISTORY: 1.0.0 - initial 1.0.1 - fixed obj.exit issue by adding obj.hide 1.2.0 - new func _AcrobatIC_JSGetObject new func _AcrobatIC_DocGetWinTitle ;=============================================================================== ; ; Function Name: _AcrobatIC_Create() ; Description: Create Acrobat Window ; Parameter(s): ; $aic_Show - Optional: specifies whether or not the Acrobat Window is visible ; True = (Default) Show window ; False = Leave window hiden ; ; Requirement(s): ; Return Value(s): On Success - Returns the AcroExch.App Object Ref ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = Object not created ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_AppCloseAllDocs() ; Description: Closes all open acrobat docs ; Parameter(s): ; $aic_obj - ref - The obj ref var ; $aic_Exit - boolean - Optional: specifies whether or not to exit Acrobat App ; False = (Default) Leave open Acrobat App ; True = Exit/Close Acrobat App ; ; Requirement(s): ; Return Value(s): On Success - Returns -1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; - 1 = Did not close ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_AppExit() ; Description: Exits Acrobat app ; Parameter(s): ; $aic_obj - ref - The obj ref var ; $aic_OnlyIfNoDocs - boolean - Optional: specifies whether to close if only no docs are open in the App ; False = (Default) Exit regardless ; True = Exit/Close Acrobat App only if docs are not open ; ; Requirement(s): ; Return Value(s): On Success - Returns -1 = "This includes closing any open documents, releasing OLE references, and finally exiting the application." ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; - 1 = couldn't close because documents were still open (only if $aic_OnlyIfNoDocs=True) ; @Extended - ; CallTip: ; Note: "This method does not work if the application is visible (if the user is in control of the application). ; In such cases, if the Show method had previously been called, you can call Hide and then Exit." This is why the obj.hide is used first ; before the obj.exit. ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_AVDocCreate() ; Description: Creates AVDoc ; Parameter(s): ; $aic_obj - ref - The obj ref var ; ; Requirement(s): ; Return Value(s): On Success - Returns the AVDoc Obj Ref ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_AVDocOpenNew() ; Description: Opens a PDF ; Parameter(s): ; $aic_oApp - ref - The obj ref var (Must be an App Obj) ; $aic_FiletoOpen - string - specifies what file to open ; $aic_DocTitle - string - Optional: specifies the document title ; '' = (Default) blank like this means the file name and location will be used as the name ; ; Requirement(s): ; Return Value(s): On Success - Returns the AVDoc Obj Ref ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = $aic_oApp is not an obj ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_AVDocClose() ; Description: Closes a PDF ; Parameter(s): ; $aic_oAVDoc - ref - The obj ref var (Must be a AVDoc Obj) ; $aic_FiletoOpen - string - specifies what file to open ; $aic_DocTitle - string - Optional: specifies the document title ; '' = (Default) blank like this means the file name and location will be used as the name ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; - 1 = obj is not a valid AcroExch.AVDoc obj ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_AVDocPrint() ; Description: Prints a PDF ; Parameter(s): ; $aic_obj - ref - The obj ref var (Must be a AVDoc Obj) ; $aic_nFirstPage - number - Optional: specifies which page to start printing ; 0 = (Default) The first page in a PDDoc object is page 0. ; $aic_nFirstPage - number - Optional: specifies which page to end printing ; -1 = (Default) The last page in the document will be used. ; $aic_nPSLevel - number - Optional: specifies which PostScriptLevel to use ; 2 = (Default) PostScript Level 2 operators are used. ; 3 = PostScript Language Level 3 operators are also used. ; $aic_nPSLevel - number - Optional: specifies to use binary data included in the PostScript program ; 0 = (Default) all data is encoded as 7-bit ASCII. ; greater than zero = binary data may be included in the PostScript program. ; $aic_bShrinkToFit number - Optional: specifies whether the page content should be shrunk (if necessary) to fir within the print area ; 0 = (Default) no shrink ; greater than zero = the page is shrunk (if necessary) to fit within the imageable area of the printed page. ; ; --- PostScript printing Only --- Below params are only --- ; $aic_bReverse - number - Optional: specifies whether the to reverse the print order (Post ; 0 = (Default) no ; greater than zero = print the pages in reverse order. If false, print the pages in the regular order. ; $aic_bFarEastFontOpt -number- Optional: specifies whether the destination printer has multibyte fonts ; 0 = (Default) no ; greater than zero = the destination printer has multibyte fonts. ; $aic_bEmitHalftones -number - Optional: specifies whether the page content should be shrunk (if necessary) to fir within the print area ; 0 = (Default) no ; --- End PostScriptOnly ----- end ; ; greater than zero = emit the halftones specified in the document ; $aic_iPageOption number - Optional: specifies Pages in the range to print. ; 0 = (Default) no shrink ; ? = Pages in the range to print. Must be one of: PDAllPages, PDEvenPagesOnly, or PDOddPagesOnly. ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; - 1 = obj is not a valid AcroExch.AVDoc obj ; - 2 = there were any exceptions while printing or no document was open ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_DocGetWinTitle() ; Description: Gets the windows title. ; Parameter(s): ; $aic_oAVDoc - ref - The obj ref var (Must be a AVDoc Obj) ; ; Requirement(s): ; Return Value(s): On Success - Returns The Doc's Win Title ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_PDDocCreateNew() ; Description: Gets the AcroExch.PDDoc associated with an AcroExch.AVDoc. ; Parameter(s): ; $aic_oPDDoc - ref - The obj ref var (Must be a PDDoc Obj) ; ; Requirement(s): ; Return Value(s): On Success - Returns -1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = the $aic_oPDDoc is not an obj ; ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_PDDocGetObject() ; Description: Gets the AcroExch.PDDoc associated with an AcroExch.AVDoc. ; Parameter(s): ; $aic_oAVDoc - ref - The obj ref var (Must be a AVDoc Obj) ; ; Requirement(s): ; Return Value(s): On Success - Returns obj id for the PDDoc ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_JSGetObject() ; Description: Gets a dual interface to the Javascript object associated with the PDDoc ; Parameter(s): ; $aic_oPDDoc - ref - The obj ref var (Must be a PDDoc Obj) ; $aic_showConsole - boolean - Optional: specifies whether or not to show the js console ; true = (Default) makes the console visible ; false = leaves the console hidden ; $aic_consoleClear - boolean - Optional: specifies whether or not to clear text in the console ; true = (Default) clears console text ; false = leaves the console text ; ; Requirement(s): ; Return Value(s): On Success - Returns The interface to the Javascript object ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = not an obj ; ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== ;=============================================================================== ; ; Function Name: _AcrobatIC_OpenFileFresh() ; Description: Open an Acrobat File by creating everything needed (see Note) ; Parameter(s): $aic_FiletoOpen - string - specifies what file to open ; $aic_Show - boolean - Optional: specifies whether or not the Acrobat Window is visible ; True = (Default) Show window ; False = Leave window hiden ; $aic_DocTitle - string - Optional: specifies the document title ; '' = (Default) blank like this means the file name and location will be used as the name ; ; $aic_ReturnObjRef number - Optional: specifies which obj to return ; 0 = (Default) Returns AcroExch.PDDoc Object Ref ; 1 = Returns AcroExch.AVDoc Object Ref ; 2 = Returns AcroExch.App Object Ref ; Requirement(s): ; Return Value(s): On Success - Returns either ; the AcroExch.App Object Ref (2) ; the AcroExch.AVDoc Object Ref (1) ; the AcroExch.PDDoc Object Ref (0) Default ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = AcroExch.App obj not created ; - 1 = AcroExch.AVDoc obj not created ; @Extended - ; CallTip: ; Note(s): This is a "self contained" file open, so _Create() and _AVDoc() are not needed. ; Author(s): John Bailey ; ;=============================================================================== EXAMPLE #include <Acrobat_InterApplication_Communication_API.au3> Global $Aapp = _AcrobatIC_Create() Local $printFile = FileOpenDialog('Select a PDF',@MyDocumentsDir,'PDF (*.pdf)') Global $AVDoc = _AcrobatIC_AVDocOpenNew($Aapp,$printFile) Local $iMsgBoxAnswer = MsgBox(36,"Print","Do you want to Print?") Select Case $iMsgBoxAnswer = 6;Yes _AcrobatIC_AVDocPrint($AVDoc) Case $iMsgBoxAnswer = 7;No EndSelect Local $iMsgBoxAnswer = MsgBox(36,"Close Doc","Do you want to?") Select Case $iMsgBoxAnswer = 6;Yes _AcrobatIC_AVDocClose($AVDoc) Case $iMsgBoxAnswer = 7;No EndSelect RESOURCES http://www.adobe.com/devnet/acrobat/interapplication.html http://developer.hoops3d.com/adobepdf/docu...APIOverview.pdf http://partners.adobe.com/public/developer...nParameters.pdf http://www.adobe.com/devnet/acrobat/pdfs/i...i_reference.pdf http://partners.adobe.com/public/developer...eveloperFAQ.pdf http://www.acrobatusers.com/blogs/thomp/index.php?paged=2 Acrobat_InterApplication_Communication_API.au3
    1 point
×
×
  • Create New...