Const WM_USER = &H400
Const CB_SHOWDROPDOWN = &H14F
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Long) As Long
Private Sub Combo1_KeyPress(KeyAscii As Integer)
Dim i As Long
If KeyAscii = 13 Then
i = SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, True, 0&)
End If
End Sub
I aggree with you partial.
When sendkeys is used withoud really setting focus to the object, bad things can occur (I even deleted an access table once because I forgot to set focus to the form when using sendkeys (DEL)).
However, if you set focus to the control, I can't think of anything that could go wrong.
Do you suggest any good articles, links, etc. pertaining to using the SendMessage API, or on messaging in general? This is an area where I can follow what is being done by others but have no idea how to go about learning how to set things up on my own. Thanks for any ideas and/or suggestions!
for sample code or just do a google search, your bound to get tons of hits.
"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.