I'm using the following code in an attempt to make a the listbox of a combobox transparent, with no luck tho. Add a combo to a form and try it please. It seems to just 'crash' the list.
VB Code:
  1. Option Explicit
  2.  
  3. Private Declare Function GetComboBoxInfo Lib "user32.dll" _
  4.   (ByVal hwndCombo As Long, _
  5.   ByRef pcbi As PCOMBOBOXINFO) As Long
  6.  
  7. Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" _
  8.   (ByVal hwnd As Long, _
  9.   ByVal nIndex As Long, _
  10.   ByVal dwNewLong As Long) As Long
  11.  
  12. Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" _
  13.   (ByVal hwnd As Long, _
  14.   ByVal nIndex As Long) As Long
  15.      
  16. Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" _
  17.   (ByVal hwnd As Long, _
  18.   ByVal crKey As Long, _
  19.   ByVal bAlpha As Byte, _
  20.   ByVal dwFlags As Long) As Long
  21.      
  22. Private Type RECT
  23.   Left As Long
  24.   Top As Long
  25.   Right As Long
  26.   Bottom As Long
  27. End Type
  28.  
  29. Private Type PCOMBOBOXINFO
  30.   cbSize As Long
  31.   rcItem As RECT
  32.   rcButton As RECT
  33.   stateButton As Long
  34.   hwndCombo As Long
  35.   hwndItem As Long
  36.   hwndList As Long
  37. End Type
  38.  
  39. Private Const GWL_EXSTYLE As Long = -20
  40. Private Const LWA_ALPHA As Long = &H2
  41. Private Const WS_EX_LAYERED As Long = &H80000
  42.  
  43. Private Sub Form_Load()
  44.   Combo1.AddItem "moo"
  45.   Combo1.AddItem "meep"
  46.   Combo1.AddItem "baaa"
  47.  
  48.   Dim pcbi As PCOMBOBOXINFO, lRet As Long
  49.  
  50.   pcbi.cbSize = Len(pcbi)
  51.  
  52.   lRet = GetComboBoxInfo(Combo1.hwnd, pcbi)
  53.  
  54.   Call SetWindowLong(pcbi.hwndList, GWL_EXSTYLE, GetWindowLong(pcbi.hwndList, GWL_EXSTYLE) Or WS_EX_LAYERED)
  55.   Call SetLayeredWindowAttributes(pcbi.hwndList, 0, 50, LWA_ALPHA)
  56. End Sub
Cheers, adehh.