AC 15.02: Problem with ShowPopupForm

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #68464
    HeDiBo
    Participant

    When debugging (I use Delphi XE4) and having a breakpoint within a form that’s part of a Popup Window shown with ShowPopupForm, at the moment the breakpoint is hit, no application and no modal window can get the cursor activated in the area bounded by by the popup window’s area (it doesn’t have to be in view, but it does monopolize that area).
    The reason of course is that normally, activating another window would discard the popup, but in this case it is suspended by the breakpoint.
    So, maybe you have to fiddle around with the Window creation parms when creating the popup window.

    #68469
    Support
    Keymaster

    Which parameters do you mean?
    Do you mean that popup window should not be closed automatically in debugging mode?

    #68471
    HeDiBo
    Participant

    I’m not sure which parameters.
    What happens is that the popup window monopolizes the mouse cursor, although it is not visible.
    Try this:
    Make a project with a popup window.In the form of the popup window set a breakpoint. Run the project in the debugger until it hits the breakpoint. Now switch to another program, let’s say the explorer. Try to select a file that is in the same area as the popup window (now hidden) is. It is not possible.

    #68507
    HeDiBo
    Participant

    This is a better view on the problem.
    It’s part of the screen with the expolorer on it. But, because the popup window’s process is in suspended state by the Delphi debugger, I cannot get rid of it. It seems to think it has to be on top always.

    Attachments:
    You must be logged in to view attached files.
    #68515
    Support
    Keymaster

    You can try to search “HWND_TOPMOST” in the acPopupController.pas unit and replace it to “HWND_TOP”.
    This is a reason.

    #68519
    HeDiBo
    Participant

    There are 5 occurrences of HWND_TOPMOST in that module. I don’t think it is a good idea to change all of them. After all, you must have had a good reason to put them there.
    I know this hWndInsertAFter parameter may cause problems if not used correctly (like a windows not showing at all). So, I’m not feeling OK about this.
    There may be another way of going about this. Maybe you could use HWND_TOPMOST only if project is not being run in the Delphi debugger. That would give the best of both worlds.

    So, in the initialization of the acPopupController have code like this:

    if System.DebugHook = 0 then hWndInsertAfter := HWND_TOPMOST
                            else hWndInsertAfter := HWND_TOP
    #68526
    Support
    Keymaster

    I will add something similar in the nearest release.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.