Black window on multi monitor setup

Hi all
I have seen an odd thing a few times.
When a few of our customers op our main desktop app and they have more than one monitor and the program starts on monitor 2 or 3 (not primary) it will have a black window. I can see the app name and the system buttons (close, maximize, minimize). But thats it.
When I minimize and maximize again the program pops up on monitor 1 again and is back to normal.
I use Clarion 11.1.13845, a bunch of Capesoft accessories and a few IceTips accessories.

Any idear?

Is this an MDI or non-MDI app?

It is an MDI app.
I have the same problem with printpreview.
If I change the primary monitor in Windows it works again.
It looks like it’s a problem if the primary monitor is the second monitor. (Not the left one).

Hi !

The problem may be related to incorrect processing by the graphics card driver of an insufficient number of Windows GDI objects. Try increasing the value of GDI objects in Windows.

  ! --- Reinstalling restrictions GDI Windows ----
  !If Int(GetReg(REG_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows','GDIProcessHandleQuota',Loc:TypeParam)) < 65000
  !   PutReg(REG_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows','GDIProcessHandleQuota',0FDE9h,Loc:TypeParam)
  !end

Usually programs cannot write to Local Machine. The help on PUTREG says:

“Vista” would also refer to 7, 8, 8.1 and 10.

The help does not specify if PUTREG sets an Error code() but I would think it does. It’s does say it returns Zero of it fails.

Of course, the Windows user must have the rights to make changes to the registry!

Yes, but it’s more involved than that.

Since the Vista UAC by default even Administrators run programs as a “Standard User” which would not be allowed to PUTREG to Local Machine. You have to run Elevated, which IMO you don’t want to do.

I would try putting your changes into a Registry Script .REG file. You could possibly Shell Execute that from your Clarion program and it would ask to elevate to admin.

1 Like

On my local computer Win10 x64, PutReg() makes changes to the registry. And I noticed earlier that Windows tools cannot save a file to the root directory of C:. But WinAPI WriteFile() performs such writing without problems…

It can sometimes be the graphics hardware acceleration.

Its changed over the years, but this link shows the settings on the different OS’es.

Latest OS, just toggle on and off, but earlier versions had a slider to reduce a notch.

How to Enable or Disable Hardware Acceleration in Windows - MajorGeeks