Код
Option Explicit
Private Declare Function FindWindowEx& Lib "user32" Alias "FindWindowExA" ( _
ByVal hWndParent As Long, _
ByVal hWndChildAfter As Long, _
ByVal lpClassName As String, _
ByVal lpWindowName As String)
Private Declare Function MoveWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal bRepaint As Long) As Long
Private Declare Function GetClientRect& Lib "user32" ( _
ByVal hwnd As Long, _
lpRect As RECT)
Private Type RECT ' 16 Bytes
left As Long
top As Long
right As Long
bottom As Long
End Type
Sub ComboBoxResize() 'изменение размера выпадающего списка слоев, цветов, типов линий
Dim MyH As Long
MyH = AcadApplication.HWND32
Dim HW As Long
HW = 0
Dim col_AfxControlBar As New Collection
Do
HW = FindWindowEx(MyH, HW, "AfxControlBar", vbNullString)
If HW > 0 Then col_AfxControlBar.Add HW
Loop While HW > 0
Dim it As Variant
Dim col_AfxWnd As New Collection
For Each it In col_AfxControlBar
HW = 0
Do
' HW = FindWindowEx(it, HW, "AfxWnd70", vbNullString)' для 2007
HW = FindWindowEx(it, HW, "AfxWnd100u", vbNullString)' для 2013
If HW > 0 Then col_AfxWnd.Add HW
Loop While HW > 0
Next it
Dim col_Toolbar As New Collection
For Each it In col_AfxWnd
HW = 0
Do
HW = FindWindowEx(it, HW, "ToolbarWindow32", vbNullString)
If HW > 0 Then col_Toolbar.Add HW
Loop While HW > 0
Next it
Dim re As Long
For Each it In col_Toolbar
HW = 0
Do
HW = FindWindowEx(it, HW, "ComboBox", vbNullString)
If HW > 0 Then
Dim r As RECT
re = GetClientRect(HW, r)
If re <> 0 Then
Dim res As Long
res = MoveWindow(HW, 0, 0, r.right, 900, 1)
End If
End If
Loop While HW > 0
Next it
End Sub
Private Declare Function FindWindowEx& Lib "user32" Alias "FindWindowExA" ( _
ByVal hWndParent As Long, _
ByVal hWndChildAfter As Long, _
ByVal lpClassName As String, _
ByVal lpWindowName As String)
Private Declare Function MoveWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal x As Long, ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal bRepaint As Long) As Long
Private Declare Function GetClientRect& Lib "user32" ( _
ByVal hwnd As Long, _
lpRect As RECT)
Private Type RECT ' 16 Bytes
left As Long
top As Long
right As Long
bottom As Long
End Type
Sub ComboBoxResize() 'изменение размера выпадающего списка слоев, цветов, типов линий
Dim MyH As Long
MyH = AcadApplication.HWND32
Dim HW As Long
HW = 0
Dim col_AfxControlBar As New Collection
Do
HW = FindWindowEx(MyH, HW, "AfxControlBar", vbNullString)
If HW > 0 Then col_AfxControlBar.Add HW
Loop While HW > 0
Dim it As Variant
Dim col_AfxWnd As New Collection
For Each it In col_AfxControlBar
HW = 0
Do
' HW = FindWindowEx(it, HW, "AfxWnd70", vbNullString)' для 2007
HW = FindWindowEx(it, HW, "AfxWnd100u", vbNullString)' для 2013
If HW > 0 Then col_AfxWnd.Add HW
Loop While HW > 0
Next it
Dim col_Toolbar As New Collection
For Each it In col_AfxWnd
HW = 0
Do
HW = FindWindowEx(it, HW, "ToolbarWindow32", vbNullString)
If HW > 0 Then col_Toolbar.Add HW
Loop While HW > 0
Next it
Dim re As Long
For Each it In col_Toolbar
HW = 0
Do
HW = FindWindowEx(it, HW, "ComboBox", vbNullString)
If HW > 0 Then
Dim r As RECT
re = GetClientRect(HW, r)
If re <> 0 Then
Dim res As Long
res = MoveWindow(HW, 0, 0, r.right, 900, 1)
End If
End If
Loop While HW > 0
Next it
End Sub