[API]
RECT
SystemParametersInfoA
CreateWindowExA
CreateWindowExW

[CODE]
Public Function CreateWindowEx_LeftDeskSize(ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal SizePerc As Single, ByVal hWndParent As Long, Optional ByVal hMenu As Long, Optional ByVal lpParam As Long) As Long
  Dim xType1 As RECT
  Dim xLong1 As Long
  Dim xLong2 As Long
  Dim xLong3 As Long
  Dim xLong4 As Long

  Call SystemParametersInfoA(48&, 0&, xType1, 0&)
  xLong1 = (xType1.Right - xType1.Left)
  xLong2 = (xType1.Bottom - xType1.Top)
  xLong3 = xLong1 * SizePerc
  If xLong3 > xLong1 Then xLong3 = xLong1
  xLong4 = xLong2 * SizePerc
  If xLong4 > xLong2 Then xLong4 = xLong2
  xLong1 = xType1.Left + Fix((xLong1 - xLong3) / 2&)
  xLong2 = xType1.Top + Fix((xLong2 - xLong4) / 2&)

  If IsUnicode Then
    CreateWindowEx_LeftDeskSize = CreateWindowExW(dwExStyle, StrPtr(lpClassName), StrPtr(lpWindowName), dwStyle, xLong1, xLong2, xLong3 / 2, xLong4, hWndParent, hMenu, App.hInstance, lpParam)
    Else
    CreateWindowEx_LeftDeskSize = CreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, xLong1, xLong2, xLong3 / 2, xLong4, hWndParent, hMenu, App.hInstance, lpParam)
    End If
  End Function