ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
'Some Constants
Private Const WS_EX_MDICHILD = &H40
Private Const GWL_EXSTYLE = (-20)Private Const SWP_NOSIZE = &H1Private Const SWP_SHOWWINDOW = &H40Private Const HTCAPTION = 2Private Const WM_NCLBUTTONDOWN = &HA1
xlDesk
Excel7
Form_Activate
OHwnd = FindWindowEx(Application.hwnd, 0, "OMain", vbNullString)
GetWindowRect hWndForm, tRect
tPt.X = tRect.LefttPt.Y = tRect.TopSetParent hWndForm, OHwndScreenToClient OHwnd, tPtSetWindowLong(hWndForm, GWL_EXSTYLE, GetWindowLong(WbHwnd, GWL_EXSTYLE) Or WS_EX_MDICHILD)SetWindowPos(hWndForm, 0, tPt.X, tPt.Y, 0, 0, SWP_SHOWWINDOW Or SWP_NOSIZE)
Form_MOUSEMOVE
If Button = 1 Then
ReleaseCaptureSendMessage hWndForm, WM_NCLBUTTONDOWN, HTCAPTION, 0&End If
CB_SETDROPPEDWIDTH=&H160
hWndXl = ApphWnd ---> ("XLMAIN") hWndFormulaBar = FindWindowEx(hWndXl, 0, _ "EXCEL;", vbNullString) hWndNameCombo = FindWindowEx(hWndFormulaBar, 0, _ "combobox", vbNullString)
https://docs.microsoft.com/en-us/windows/win32/controls/cb-getdroppedwidth
'CB_GETDROPPEDWIDTH message
'Parameters
'wParam : Not used; must be zero.
'lParam : Not used; must be zero.
'Return value :
'If the message succeeds, the return value is the width, in pixels. 'drop down width SendMessage hWndNameCombo,CB_SETDROPPEDWIDTH, 200, 0
CB_SETEDITSEL message :
Parameters
wParam :This parameter is not used
lParam [in]
The LOWORD of lParam specifies the starting position. If the LOWORD is -1, the selection, if any, is removed.
The HIWORD of lParam specifies the ending position. If the HIWORD is -1, all text from the starting position to the last character in the edit control is selected.
If the message succeeds, the return value is TRUE. If the message is sent to a combo box with the CBS_DROPDOWNLIST style, it is CB_ERR.
The positions are zero-based. The first character of the edit control is in the zero position. The first character after the last selected character is in the ending position. For example, to select the first four characters of the edit control, use a starting position of 0 and an ending position of 4