善用 API 的SendMessage 来提高 插入 VB.ComboBox Item 的速度

善用 API 的SendMessage 来提高 插入 ComboBox Item 的速度

经测试,可以比 VB.Combo.Add 提升大约3倍的速度

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_ADDSTRING = &H143

 SendMessage Combo1.Wnd, CB_ADDSTRING, 0, ByVal ItemText

你可能感兴趣的:(api,function,user,测试)