Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Answered SHELLEXECUTE() to open RTF Hangs Application.

  • Friday, September 07, 2012 5:11 PM
     
     

    Hi,

    I'm using SHELLEXECUTE to open an RTF document when the user does not have word installed.  

    Some users are reporting that the application is hanging.  

    I have determined that there is an invisible dialog "Convert File" that only becomes visible it you access it from the TaskMgr

    Question:  Is there a setting in SHELLEXECUTE that will either surface the dialog or prevent it?

    lcRTFName = 'c:\Temp\SomeRTF.rtf'

    shellexecute(0, "Open", lcRTFName, "", "", 1)


    Sam

All Replies

  • Friday, September 07, 2012 10:54 PM
     
     
    What program are you talking about? Is it wordpad? I've looked at Wordpad's dialogs and there is a converting dialog (it's just a progress bar).
     
    Try using a valid HWnd in the call.

    --
    .
    --
    "TheSoftwareShop Inc_" wrote in message news:02cbf343-d0b5-47d0-ace9-723bf27b198a...

    Hi,

    I'm using SHELLEXECUTE to open an RTF document when the user does not have word installed.  

    Some users are reporting that the application is hanging.  

    I have determined that there is an invisible dialog "Convert File" that only becomes visible it you access it from the TaskMgr

    Question:  Is there a setting in SHELLEXECUTE that will either surface the dialog or prevent it?

    lcRTFName = 'c:\Temp\SomeRTF.rtf'

    shellexecute(0, "Open", lcRTFName, "", "", 1)


    Sam

  • Friday, September 07, 2012 11:08 PM
     
     
    Are you sure your file is rtf. Your code works fine in vb6.
     
    Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, lpParameters As Any, lpDirectory As Any, ByVal nShowCmd As Long) As Long
     
    Sub Main()
        lcRTFName = "c:\Temp\SomeRTF.rtf"
        a = ShellExecute(0, "Open", lcRTFName, "", "", 1)
    End Sub

    --
    .
    --
    "TheSoftwareShop Inc_" wrote in message news:02cbf343-d0b5-47d0-ace9-723bf27b198a...

    Hi,

    I'm using SHELLEXECUTE to open an RTF document when the user does not have word installed.  

    Some users are reporting that the application is hanging.  

    I have determined that there is an invisible dialog "Convert File" that only becomes visible it you access it from the TaskMgr

    Question:  Is there a setting in SHELLEXECUTE that will either surface the dialog or prevent it?

    lcRTFName = 'c:\Temp\SomeRTF.rtf'

    shellexecute(0, "Open", lcRTFName, "", "", 1)


    Sam

  • Saturday, September 08, 2012 3:12 PM
     
     

    David,

    Thanks for the replies - greatly appreciated.

    The shellexecute solution works on 95% of users machines (This is a vertical app).

    The full chain of events is that the command is issued, the app hangs and eventually surfaces a  switch to task dialog.

    Checking the TaskMgr reveals this dialog: I'm wondering if this is even a windows Dialog.

     


    Sam


  • Saturday, September 08, 2012 10:21 PM
     
     
    I don't think it is. It's not wordpad.
     
    Try executing Wordpad direct
     
    shellexecute(0, "Open","c:\program files\Windows NT\Wordpad.exe" , lcRTFName, "", 1)
    --
    .
    --
    "TheSoftwareShop Inc_" wrote in message news:8a70cc79-41cb-4709-9772-d3b0a4cbe090...

    David,

    Thanks for the replies - greatly appreciated.

    The shellexecute solution works on 95% of users machines (This is a vertical app).

    The full chain of events is that the command is issued, the app hangs and eventually surfaces a  switch to task dialog.

    Checking the TaskMgr reveals this dialog: I'm wondering if this is even a windows Dialog.

     


    Sam


  • Saturday, September 08, 2012 10:53 PM
     
     
    It  must be an office app as Recover Text From Any File is an Office converter.

    --
    .
    --
    "DavidMCandy" wrote in message news:75d26e11-c6f7-4605-bae1-47367ae9c46b...
    I don't think it is. It's not wordpad.
     
    Try executing Wordpad direct
     
    shellexecute(0, "Open","c:\program files\Windows NT\Wordpad.exe" , lcRTFName, "", 1)
    --

    --
    "TheSoftwareShop Inc_" wrote in message news:8a70cc79-41cb-4709-9772-d3b0a4cbe090...

    David,

    Thanks for the replies - greatly appreciated.

    The shellexecute solution works on 95% of users machines (This is a vertical app).

    The full chain of events is that the command is issued, the app hangs and eventually surfaces a  switch to task dialog.

    Checking the TaskMgr reveals this dialog: I'm wondering if this is even a windows Dialog.

     


    Sam


  • Sunday, September 09, 2012 1:31 AM
     
     Answered
    It is an office app. Word 2002 has that dialog when opening RTF files.

    --
    .
    --
    "DavidMCandy" wrote in message news:990b21b8-45ae-4261-ad64-90d662dc4a43...
    It  must be an office app as Recover Text From Any File is an Office converter.

    --

    --
    "DavidMCandy" wrote in message news:75d26e11-c6f7-4605-bae1-47367ae9c46b...
    I don't think it is. It's not wordpad.
     
    Try executing Wordpad direct
     
    shellexecute(0, "Open","c:\program files\Windows NT\Wordpad.exe" , lcRTFName, "", 1)
    --

    --
    "TheSoftwareShop Inc_" wrote in message news:8a70cc79-41cb-4709-9772-d3b0a4cbe090...

    David,

    Thanks for the replies - greatly appreciated.

    The shellexecute solution works on 95% of users machines (This is a vertical app).

    The full chain of events is that the command is issued, the app hangs and eventually surfaces a  switch to task dialog.

    Checking the TaskMgr reveals this dialog: I'm wondering if this is even a windows Dialog.

     


    Sam


  • Sunday, September 09, 2012 2:18 PM
     
     

    David,

    Thanks a Million, That tells me where to look!

    I'll reply with the solution we implemented.


    Sam