Kombat Posted February 11, 2011 Share Posted February 11, 2011 There is a long delay when a PDF loads, so ... how can I display a progress message while the PDF is loading and dismiss the progress when the load is fully completed? Just putting progress bars don't work, as they get dismissed when the function ends, but the PDF has not loaded yet. $oPDF = ObjCreate("AcroPDF.PDF.1") $GUI_ActiveX = GUICtrlCreateObj($oPDF, 319, 4, 697, 618) GUICtrlSetStyle($GUI_ActiveX, $WS_VISIBLE) GUICtrlSetResizing($GUI_ActiveX, $GUI_DOCKAUTO) ; Auto Resize Object _Show_PDF("Testfile") ;Here's the function that loads the PDF Func _Show_PDF($m) ;I want to display a progress bar here ;============================= ;$oPDF = ObjCreate("AcroPDF.PDF.1") $oPDF.src = $m ; Clear up $Obj1 = "" ;I want to dismiss the progress bar here ;=============================== EndFunc ;==>_Show_PDF I have looked in the Forum, and this topic did not show up. Any suggestions? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 11, 2011 Moderators Share Posted February 11, 2011 Kombat, Try a marquee progress - then you do not have to worry about the duration: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) GUICtrlSendMsg(-1, $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Any use? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Kombat Posted February 11, 2011 Author Share Posted February 11, 2011 Kombat, Try a marquee progress - then you do not have to worry about the duration: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE) GUICtrlSendMsg(-1, $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Any use? M23 Thanks, but the progress bar will dismiss before the PDF has loaded. Even though in theory the PDF should be loaded when the function ends, it is not. There is a very long delay, that varies by file size, and I want to determine when the control has completed refreshing before dismissing the progress bar. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now