Announcement

Collapse
No announcement yet.

OpenFileDialog and double click

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenFileDialog and double click

    If I double-click on a file in OpenFileDialog called as below, it appears to select the file OK and dismiss the open dialog, both good, but also my app picks up the mouse click (or clicks? haven't worked out which), which is not so good.

    Has anyone else noticed this, and/or can suggest a remedy?

    Code:
    '---------------------------------------------------------------------
    FUNCTION getpic (hD AS LONG) AS STRING
        LOCAL buf, spath, sfile AS STRING
        LOCAL dwstyle AS DWORD
        LOCAL hFile AS LONG
    
        '------------------------ get picture file
        dwStyle = %OFN_EXPLORER OR %OFN_FILEMUSTEXIST OR %OFN_HIDEREADONLY
        Buf   = "Picture files (*.JPG)|*.JPG|"
        'IF gddlpath <> "" THEN spath = gddlpath
        IF OpenFileDialog (hD, "Locate JPG file ", sfile, spath, buf, "JPG", dwstyle) = 0 THEN
           EXIT FUNCTION
        END IF
        FUNCTION = sfile
    END FUNCTION

  • #2
    Shouldn't, unless you are double clicking the OK/Open/Save Button like another recent thread talks about (Or Triple Clicking the file...). Double clicking the file or single clicking the file and single clicking OK/Open/Save should work fine without anything going to your app.
    sigpic
    Mobile Solutions
    Sys Analyst and Development

    Comment


    • #3
      Originally posted by Chris Holbrook View Post
      If I double-click on a file in OpenFileDialog called as below, it appears to select the file OK and dismiss the open dialog, both good, but also my app picks up the mouse click (or clicks? haven't worked out which), which is not so good.

      Has anyone else noticed this, and/or can suggest a remedy?
      ...
      Just a random thought:
      Is your app using DDT? If so, you might be getting multiple windoze messages depending on what & how the app deals with the return string.
      Do not go quiet into that good night,
      ... Rage, rage against the dark.

      Comment


      • #4
        Explorer-Style hook Procedures for OpenFileDialog and SaveFileDialog 3-31-07
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Thanks for the help chaps, problem solved, the mouse was captured.

          Comment

          Working...
          X