Announcement

Collapse
No announcement yet.

Close Current Dialog with Left Mouse Click?

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

  • Close Current Dialog with Left Mouse Click?

    Hi,

    My DDT maindialog calls a SUB ROUTINE that creates a topmost dialog with call back. How can user left mouse click outside of current running dialog and have it close? If users left clicks on maindialog, can
    I send a message to current running dialog to close?

    Thanks,

    Brent
    Last edited by BRENT GARDNER; 17 Oct 2007, 08:49 AM. Reason: format

  • #2
    Looks like it happens automatically if I have the "Dialog End cbhndl, 1"
    after each case. Great - sorry to bother.

    Well, It happens automatically in Windows XP, but not in Windows 98?
    Last edited by BRENT GARDNER; 17 Oct 2007, 08:50 AM. Reason: Additional comments

    Comment


    • #3
      Windows 98 Issues

      Hi,

      My Windows XP, Maindialog, buttons call a Sub, which creates a POPUP dialog with CALLBACK with case structure. Each Case calls a SUBROUTINE that does whatever. Weird thing is, while POPUP dialog is open, if user clicks anywhere on Maindialog, even another button, POPUP dialog closes and fucus goes to button clicked on or just closes
      if user clicked on Maindialog. Great! I can't figure out why?

      Windows 98, while POPUP dialog is open, if user clicks anywhere on Maindialog, POPUP dialog DOES NOT CLOSE? But if they then click on open POPUP dialog, it will close. If user clicks a button on maindialog, while POPUP dialog is open, it executes button, so you can execute more than one button at a time. Wierd, Not Good!

      How can I code same program in Windows 98 to act like it does in XP?

      POPUP DIALOG STYLE:
      Code:
      DIALOG NEW hParent, "File Utilities", a1, b1, a2, b2, %WS_BORDER OR %WS_POPUP TO hDlg49
      Maindialog style:
      Code:
      DIALOG NEW %HWND_DESKTOP, $AppTitle, 0, 0, x2, y2, _                                 
          %DS_CENTER OR %DS_SETFONT OR %WS_CAPTION OR %WS_SYSMENU OR %WS_MINIMIZEBOX _
          OR %WS_OVERLAPPEDWINDOW, %WS_EX_CONTROLPARENT, TO hDlg
      Thanks,

      Brent

      Comment


      • #4
        Got it working for now! Must of had some bad code somewhere?
        Posting this solution encase someone might run into similar issue.
        In create popup dialog sub:
        Code:
              REM IF opersy = "95" OR opersy = "98" OR opersy = "98SE" THEN
              REM ' To keep pop up dialog on top.
              REM SetWindowPos hDlg50, %HWND_TOPMOST,0,0,0,0,%SWP_NOMOVE OR %SWP_NOSIZE
              REM END IF
        In CallBack, removed the rem code below, which was always needed before?
        Code:
               CASE %WM_INITDIALOG                      ' <- sent right before the dialog is displayed.
                SetForegroundWindow(CBHNDL)             ' Need for Windows XP and 98, 10-17-2007
                ' REMMING BELOW, ALLOWS DIALOG TO CLOSE IF USER LFT CLKS OUTSIDE DIALOG, 10-16-2007
                REM CONTROL SET FOCUS CBHNDL, %IDL_ADDEXP ' FOR WINDOWS 98 OR HAVE TO PRESS <tab> key
                REM CONTROL SEND CBHNDL, %IDL_ADDEXP, %EM_SETSEL, 0, -1' Needed for Windows 98

        Comment

        Working...
        X