Page 3 of 6

Re: Problem with disabled windows on Terminal Server

Posted: Thu Feb 16, 2023 5:23 pm
by rdonnay
Visual Edlin
I remember that. It was the talk of the whole conference.

Re: Problem with disabled windows on Terminal Server

Posted: Fri Feb 17, 2023 7:43 am
by Tom
I was never forced to use Edlin. We have a word in german, "grace of late birth", do you know that? 8-) (To be honest, it's just a little later birth.)

Re: Problem with disabled windows on Terminal Server

Posted: Thu Feb 23, 2023 3:50 am
by Tom
Hi, Roger.

I was in contact with Till again about this problem. He confirmed the (mis-)behaviour, but Alaska is not going to change something there. This is what he wrote as a suggestion for a solution (translated with Google):

Once again the proposed solution: in my tests, the xbeP_SetDisplayFocus event arrived at the point in time at which :isEnabled() returned False. So it would be easy to suppress the event when this (fault) condition occurs and from your description this would be correct in your case even if the dialog actually gets the display focus (see the scenario with the taskbar above), there applies: deactivated == Do not touch my children.

The test could be done in the implementation of XbpDialog:handleEvent() or in a class derived from it. Since Roger is already involved: surely something like this would be easy to implement in the eXpress framework?

Re: Problem with disabled windows on Terminal Server

Posted: Thu Feb 23, 2023 6:40 am
by rdonnay
Tom -

I agree with Till that this is something I could handle in the DC_XbpDialog() class, however I need a way to test this.

Is it possible for you to give me a temporary account on a server that demonstrates the problem?

If you can't do that, I think I have a customer who has a more current version of terminal server.
I will ask him.

Re: Problem with disabled windows on Terminal Server

Posted: Thu Feb 23, 2023 7:23 am
by rdonnay
I'm working on Till's suggestion, however IsEnabled() always returns .T. even when the Main Window cannot receive focus.

This is my new class method:

Code: Select all

METHOD DC_XbpDialog1:handleEvent( nEvent, mp1, mp2 )

IF nEvent == xbeP_SetDisplayFocus
  wtl ::title, ::isEnabled()
ENDIF

RETURN ::XbpDialog:handleEvent( nEvent, mp1, mp2 )
I need to figure some other way to determine the status of the main window.
I'm going to try ::hasDisplayFocus

Re: Problem with disabled windows on Terminal Server

Posted: Thu Feb 23, 2023 11:15 am
by rdonnay
I made a mistake when testing for ::isEnabled().
I was looking at the wrong window.

Please make this change to _DCGETBX.PRG and give it a try.

Add a new method to DC_XbpDialog1() class - Line 12955

Code: Select all

Was:    METHOD Init, Create, Resize, Show, Destroy, setButtons, setOffset

Is:  METHOD Init, Create, Resize, Show, Destroy, setButtons, setOffset, handleEvent

METHOD DC_XbpDialog1:handleEvent( nEvent, mp1, mp2 )

IF nEvent == xbeP_SetDisplayFocus .AND. !::isEnabled()
  RETURN nil
ENDIF

RETURN ::XbpDialog:handleEvent( nEvent, mp1, mp2 )

Re: Problem with disabled windows on Terminal Server

Posted: Fri Feb 24, 2023 1:37 am
by skiman
Hi,

I did the test and the error remains.

Procedure:
- Change of code
- New dclipx.dll
- Restarted server
- Login on server with RDP
- Start the sample and open the modal dialog.
- Disconnect from server.
- Login on server with RDP
- Error is on screen.

Re: Problem with disabled windows on Terminal Server

Posted: Fri Feb 24, 2023 7:30 am
by rdonnay
This change was the one that Till suggested, yet it didn't solve the problem.
Possibly, preventing the event handling does no good.
Or it could be an error that occurs before there is any event to handle.

Please try the below debugging.
This will write to a file named DEBUG.LOG.
If it never gets to the event handler before the error occurs, then I don't know what to do next.

BTW - You need to give titles to both windows: Main Window, Test Window.

Code: Select all

METHOD DC_XbpDialog1:handleEvent( nEvent, mp1, mp2 )

WTL DC_AppEventDefine(nEvent), ::title

IF nEvent == xbeP_SetDisplayFocus .AND. !::isEnabled()
  RETURN nil
ENDIF

Re: Problem with disabled windows on Terminal Server

Posted: Tue Feb 28, 2023 1:58 am
by Tom
Sorry for my late answer; I once again had that top-modern corona-thing, although I'm vaccinated at least twenty or thirty times. 8)

I will test that later the day. Unfortunatley, I can't give you a guest access to our RDP server.

Re: Problem with disabled windows on Terminal Server

Posted: Tue Feb 28, 2023 2:27 am
by Tom
Here is the log. It seems to be the xbeP_SystemPropertyChanged event causing trouble.