Sign in to follow this  
Followers 0
ajit

Unresponsive GUI

6 posts in this topic

#1 ·  Posted (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 by ajit

Share this post


Link to post
Share on other sites



ajit,

Works for me if I force the immediate return of _IENavigate: :mellow:

_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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

@Melba23

Thanks for your guidance.

_IENavigate ($oIE, $pdf_file, 0) did the trick.

Thanks again

Regards

Ajit

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

#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

Share this post


Link to post
Share on other sites

Please help me with this

Ajit

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0