Check the "Enable DPI aware executable" option, and then run the code.
Tested with PB 5.70 x86/x64 on Windows 10 x64 and 7 x64 (125% DPI).
Code:
If OpenWindow(0, 0, 0, 400, 300, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ComboBoxGadget(0, 10, 10, 200, 40)
ExplorerComboGadget(1, 10, 80, 200, 40, "")
Debug DesktopResolutionX() ; 1.25
Debug DesktopResolutionY() ; 1.25
Debug "------------"
Debug "ComboBoxGadget"
Debug GadgetWidth(0) ;200
Debug GadgetHeight(0) ;40
ResizeGadget(0, #PB_Ignore, #PB_Ignore, 200, #PB_Ignore)
Debug "Resize width"
Debug GadgetWidth(0) ;200
Debug GadgetHeight(0) ;39 <-- wrong
FreeGadget(0)
ComboBoxGadget(0, 10, 10, 200, 40)
ResizeGadget(0, #PB_Ignore, #PB_Ignore, #PB_Ignore, 40)
Debug "Resize height"
Debug GadgetWidth(0) ;200
Debug GadgetHeight(0) ;39 <-- wrong
FreeGadget(0)
ComboBoxGadget(0, 10, 10, 200, 40)
ResizeGadget(0, #PB_Ignore, #PB_Ignore, 200, 40)
Debug "Resize width and height"
Debug GadgetWidth(0) ;200
Debug GadgetHeight(0) ;39 <-- wrong
FreeGadget(0)
ComboBoxGadget(0, 10, 10, 200, 40)
ResizeGadget(0, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore)
Debug "No resizing"
Debug GadgetWidth(0) ;200
Debug GadgetHeight(0) ;39 <-- wrong
Debug "------------"
Debug "ExplorerComboGadget"
Debug GadgetWidth(1) ;200
Debug GadgetHeight(1) ;40
ResizeGadget(1, #PB_Ignore, #PB_Ignore, 200, #PB_Ignore)
Debug "Resize width"
Debug GadgetWidth(1) ;200
Debug GadgetHeight(1) ;40
FreeGadget(1)
ExplorerComboGadget(1, 10, 80, 200, 40, "")
ResizeGadget(1, #PB_Ignore, #PB_Ignore, #PB_Ignore, 40)
Debug "Resize height"
Debug GadgetWidth(1) ;200
Debug GadgetHeight(1) ;32 <-- wrong
FreeGadget(1)
ExplorerComboGadget(1, 10, 80, 200, 40, "")
ResizeGadget(1, #PB_Ignore, #PB_Ignore, 200, 40)
Debug "Resize width and height"
Debug GadgetWidth(1) ;200
Debug GadgetHeight(1) ;32 <-- wrong
FreeGadget(1)
ExplorerComboGadget(1, 10, 80, 200, 40, "")
ResizeGadget(1, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore)
Debug "No resizing"
Debug GadgetWidth(1) ;200
Debug GadgetHeight(1) ;40
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf