ajit Posted February 18, 2010 Share Posted February 18, 2010 (edited) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUIActiveX = GUICtrlCreateObj($oIE, 20, 10, 600, 500) $GUI_Button_browse = GUICtrlCreateButton("Browse", 430, 540, 100, 30) GUISetState() ;Show GUI ; Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_Button_browse $pdf_file = FileOpenDialog("123", @ScriptDir & "\", "Pdf files (*.pdf)", 1) _IENavigate ($oIE, $pdf_file ) EndSelect WEnd GUIDelete() Exit HI: I have a GUI, directly taken from help file, which I modified to open pdf files. The opening of pdf file is fine, but after that the GUI becomes unresponsive, does not close with $GUI_EVENT_CLOSE. Please help me out. Ajit Edited February 18, 2010 by ajit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 18, 2010 Moderators Share Posted February 18, 2010 ajit,Works for me if I force the immediate return of _IENavigate: _IENavigate ($oIE, $pdf_file, 0)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...
ajit Posted February 18, 2010 Author Share Posted February 18, 2010 @Melba23Thanks for your guidance._IENavigate ($oIE, $pdf_file, 0) did the trick.Thanks againRegardsAjit Link to comment Share on other sites More sharing options...
whim Posted February 18, 2010 Share Posted February 18, 2010 @ajit In the code in post 1, your GUIDelete() is 'dead code', because of the Exit in the While..Wend loop. You could either change Exit -> ExitLoop, or remove GUIDelete() HTH, wim Link to comment Share on other sites More sharing options...
ajit Posted February 18, 2010 Author Share Posted February 18, 2010 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <TabConstants.au3> _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUI_Button_browse = GUICtrlCreateButton("Browse", 430, 530, 100, 30) $tabs = GUICtrlCreateTab(10, 10, 600, 500, $TCS_FIXEDWIDTH) GUICtrlSetResizing($tabs, $GUI_DOCKRIGHT + $GUI_DOCKTOP) $PDF_TAB = GUICtrlCreateTabItem("TAB1") $GUIActiveX = GUICtrlCreateObj($oIE, 30, 50, 480, 380) GUISetState() ;Show GUI ; Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_Button_browse $pdf_file = FileOpenDialog("123", @ScriptDir & "\", "Pdf files (*.pdf)", 1) _IENavigate ($oIE, $pdf_file, 0 ) EndSelect WEnd I am sorry to come again with the same topic. The script worked fine until I used it in a GUI with tab control. The problem here is a little different, the adobe reader gets stuck when I try to scroll the pages. I think it is due to my wrong coding but cannot help myself. Please help me. Ajit Link to comment Share on other sites More sharing options...
ajit Posted February 19, 2010 Author Share Posted February 19, 2010 Please help me with this Ajit 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