How to get / make persistent ListBox hwnd property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using the sendMessage api call to return information about my OLE ListBox
object.

Using
Form.lbobject_name = setfocus
varHwnd = GetFocus

Syntax to get the listbox handle to pass to the api function. But returns a
0 and error checking code returns 0 (err.lastdllerror) as well??

Similarly, Get_ListBoxInfo returns 0 as well?

Is the handle not detected or is it just not possible to use OLE listboxes
with api calls?
 
What do you mena by "OLE Listbox"? Aer you using a third party ListBox
ActiveX control or the standard Access ListBox control?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Do you have the GetFocus API declared at module-level?
Public Declare Function GetFocus Lib "user" () As Long

Also, you're using the following code:
Form.lbobject_name = setfocus

That doesn't do anything. I think the syntax you're looking for is:
Me!lstMyListBox.SetFocus

....so the entire code segment should be:
Me!lstMyListBox.SetFocus 'or Forms!SomeForm!lstMyListBox.SetFocus
varHwnd = GetFocus()

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Hi. Thanks for replying.

I'm using the standard Access ListBox Control. Also, typo in my first post.

I meant
Form.lbobject_name.setfocus
varHwnd = GetFocus

I have the GetFocus api Function declared. I've tried using the sendmessage
and getlistboxinfo functions but get 0 return value? Application is for
managing city crews and I want to show the tooltip when the mouse is moved
over the listbox to disply the entire string. I'd like to avoid the complex
way you do it if possible. MS Support search indicates hwnd is not persistent.
 
The hWnd is persistent for specific Access controls including the
ListBox. Ms Support is referring to the lightweight controls such as
the TextBox, Label and the the majority of the other intrinsic controls.

THe Access ListBox control is heavily subclassed version of a normal
ListBox control. It does not respond to most of the normal ListBox
Messages. This is why I developed my Tooltips class to include the
Access ListBox control.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top