10-25-2018, 05:10 PM
So I have this macro who's main job is to show me the date time and the number of unread messages in my Outlook window. But, when it's running it forces both QM and Outlook to use 10% and 30% cpu respectively.
What am I doing wrong here to make it so inefficient? Any thoughts would be most appreciated.
Function OSD_clock
What am I doing wrong here to make it so inefficient? Any thoughts would be most appreciated.
Function OSD_clock
;shows clock in middle of specified monitor
_monitor=0
out
int z hidn clpbd w
str s clpbds value
Acc a
rep
,s.time("%X %d - %a")
,s.from(" " s " ")
,err-
,w=win("* - [email protected] - Outlook" "rctrl_renwnd32" "" 0x1)
,a.Find(w "OUTLINEITEM" "Inbox*" "class=NetUIHWND" 0x1005)
,value=a.Name
,err+
,,value="Outlook not connected"
,if len(value)>0
,,value.replacerx("[^\d]" "")
,s.from(s " " value)
,hidn= hid(win("tim4924" "QM_OSD_Class_Rd" "qm"))
,err
,if hidn=0
,,OnScreenDisplay s -1 675 -2 "Copperplate Gothic Bold" 14 0x00ffff 25|0x8000 "tim4924" 0x343434
,0.1