1. Esteban Rodriguez
  2. PowerBuilder
  3. Tuesday, 3 October 2023 18:45 PM UTC

Hi Appeon team

I am using PowerBuilder 22's themes and when app retrieves huge data and waits for response from 3rd parties for a while, the application shows a black screen. I have checked removing the theme, it throws the state "not responding mode" but not the black screen. Is there any way to resolve this issue?

John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 3 October 2023 19:45 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Esteban -

If an application does not process any event messages from the active window's message queue, the Windows O/S "hides" the application from the desktop and displays in its place the last known image of the window that the O/S rendered, with a custom title/caption and a working "X" (cancel) button in the upper-right corner. This is called "ghosting" and it is a feature of Windows.

PB apps that do NOT use themes utilize the Windows O/S to render the window, so the user sees the "ghosted" window after five seconds of waiting (such as waiting for a long-running database retrieval to complete, for example).

When PB themes are used, I believe PB takes over the rendering of the application/windows from the Windows O/S, so Windows has no knowledge of what the application is displaying... the result is an empty, black rectangle when ghosting takes effect.

You can disable the "ghosting" feature that Windows provides after five seconds of waiting for a process/activity to finish, using the following Windows API external function declaration in PB:

    Subroutine DisableProcessWindowsGhosting() Library "user32.dll"

Then call the API function in PowerScript:

    DisableProcessWindowsGhosting()

Once disabled, it is turned off for the life of the process/application... there is no way to turn this feature back on.

If you want to learn more about unresponsive Windows application, you may wish to read the following article:

    https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/325-why-unresponsive-application-windows-are-ghosted-by-the-windows-o-s

Best regards, John

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Tuesday, 3 October 2023 22:22 PM UTC
  2. PowerBuilder
  3. # 2

"retrieves huge data and waits for response from 3rd parties"

It is waiting for a huge amount of data to retrieve and your 3rd party to finish. Can you recode to make the processes run faster (maybe make them smaller and run them in a loop with a yield or something)?

 

another option is to use shared objects/threads and do your blocking processes in there.  this is difficult to do, but will provide the best results.

Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Thursday, 5 October 2023 15:42 PM UTC
  2. PowerBuilder
  3. # 3

In addition to what others have said, have you tried SetRedraw(FALSE) then set it back to true when the long running process finishes?

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.