Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Constants, prefix the name with the module name and a period.
Use this method to get the list of items out of a combo box using Windows API call (SendMessage). You need to
get the count of items in the combo box first (also with SendMessage api).
''' <summary>
''' Created by Allen Forrester (forrester72a@gmail.com)
''' </summary>
''' <param name="windowHandle">Window handle of combo box</param>
''' <returns>List of items within combo box.</returns>
''' <remarks></remarks>
Public Function GetComboBoxList(ByValwerwerwe windowHandle As Integer) As List(Of String)
Try
' List for return
Dim cBoxList As New List(Of String)
' stringbuilder for converting value to text
Dim winText As New StringBuilder()
' get count of combobox
Dim lCount As Integer = GetComboBoxCount(windowHandle)
' if count is 0, return new list of nothing
If lCount = 0 Then Return New List(Of String)
' loop through items in combobox
For i As Integer = 0 To lCount - 1
' index obj
Dim iPtr As New IntPtr(i)
' pointer
Dim zero As New IntPtr(0)
' length of string
Dim ptrLength As Integer = SendMessage(windowHandle, ComboBox_GetComboBoxTextLength, iPtr, zero)
' string builder to send
winText = New StringBuilder(ptrLength + 1)
' call api
SendMessage(windowHandle, ComboBox_GetComboBoxText, iPtr, winText)
' convert it to text
cBoxList.Add(winText.ToString)
Next
Return cBoxList
Catch
Return New List(Of String)
End Try
End Function
None.
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it!