Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EnumTrayIcons Error
#2
NOTE: Look for updated function in
EnumTrayIcons Error
or
Collected QM apps, functions, samples

Did you notice some specific conditions when it happens? For example, only when computer is busy, or only when some program is running.
Is it on Vista? If yes, is QM running as User (Options -> General).
How if you replace EnumTrayIcons code to this:

Function EnumTrayIcons
Code:
Copy      Help
;/
function hwnd ARRAY(TRAYICON)&a

;Gets tray icon data for all icons. The data contains button id, tooltips and visible/hidden state.

;hwnd - tray toolbar control handle or 0.

;EXAMPLE
;out
;type TRAYICON str'tooltip !hidden idCommand
;ARRAY(TRAYICON) a
;EnumTrayIcons 0 a
;int i
;for i 0 a.len
,;if(!a[i].hidden)
,,;out a[i].tooltip


a.redim
if(!hwnd) hwnd=child("" "ToolbarWindow32" "+Shell_TrayWnd" 0x1)
int i n=SendMessage(hwnd TB_BUTTONCOUNT 0 0)
if(!n) ret

TBBUTTON* bq=share
for i 0 1000
,TBBUTTON* be=share(hwnd)
,err if(i=999) end ES_FAILED; else 0.01; continue
,break
word* tq=bq+sizeof(TBBUTTON)
word* te=be+sizeof(TBBUTTON)

for i 0 n
,if(!SendMessage(hwnd TB_GETBUTTON i be)) continue
,if(SendMessage(hwnd TB_GETBUTTONTEXTW bq.idCommand te)<0) continue
,TRAYICON& ti=a[]
,ti.tooltip.ansi(tq)
,ti.hidden=bq.fsState&TBSTATE_HIDDEN!0
,ti.idCommand=bq.idCommand


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)