Print Page | Close Window

DPI Miscalculation: Controls update @hide+unhide

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: https://forum.codejock.com/forum_posts.asp?TID=24701
Printed Date: 04 November 2026 at 1:22pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: DPI Miscalculation: Controls update @hide+unhide
Posted By: lsswiss
Subject: DPI Miscalculation: Controls update @hide+unhide
Date Posted: 04 November 2026 at 4:02am
Since you are developing Version 26, here is a real problem in 24.3 and 26 Beta (yes it still exists in Beta, I tested it):

If you run VB6 under a dpiAware-Manifest with the dpi-Setting set to true, then your process should run natively dpi aware.

On 100%, 150%, 200% everything works fine and the controls are well placed.

But if you go with 225% or 175% DPI setting in Windows, then many Codejock Suite controls are not well placed, until you hide them and show them again.

Before hide/unhide the sample looks like this:



Note, how many controls are not within right borders.

After hide and unhide it looks like this, which is right:



The Line that is necessary in the vb6.exe.manifest to see this behaviour, is:
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>

Test it with the SuiteControls sample under the path:
C:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v24.3.0\Samples\Controls\VB\SuiteControls

Just add the following lines to the example to get the proof how it updates some controls when you set visible first to false and then to true again:

Private Sub Form_Activate()
  
  On Error Resume Next
  
  Dim ctrl As VB.Control
  Dim oldTimer As Single
  
  'Wait 5 seconds to see the before:
  oldTimer = Timer
  Me.Caption = "Go Ahead!"
  Do While Timer < oldTimer + 5
    DoEvents
  Loop
  
  For Each ctrl In Me.Controls
    If TypeName(ctrl) <> "Menu" Then
      Me.Caption = "Now: " & ctrl.Name
      Debug.Print "Now: " & ctrl.Name
      If ctrl.Name = "mnuPopup" Then Stop
      
      ctrl.Visible = False
      ctrl.Visible = True
      
      DoEvents
      
      'Uncomment, if you want to slow it down a bit:
      'oldTimer = Timer
      'Do While Timer < oldTimer + 0.1
      '  DoEvents
      'Loop
    End If
  Next
End Sub

-----

If you want a complete manifest file that you drop to a text file at C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE.manifest, here the manifest that I used, then start VB6 again:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly
  xmlns="urn:schemas-microsoft-com:asm.v1"
  manifestVersion="1.0"
>
  <assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="*"
    name="Visual Basic 6"
    type="win32"
  />
  <description>
    Visual BASIC RAD IDE
  </description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        processorArchitecture="*"
        publicKeyToken="6595b64144ccf1df"
        language="*"
      />
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
  <security>
   <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
    <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
    </requestedPrivileges>
   </security>
  </trustInfo>
  <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <asmv3:windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>  




Replies:
Posted By: lsswiss
Date Posted: 04 November 2026 at 5:07am
I have to update: with a Windows DPI setting of 100%, 150%, 250% or 300% everything works fine with Codejock Suite ActiveX Controls.

The problems appear if the Windows DPI setting has a value of like for example:

- 175%
- 200%
- 225%



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net