;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives ;Copyright © 2006-2007 A. Chilaru ; ;This program is free software; you can redistribute it and/or ;modify it under the terms of the GNU General Public License ;as published by the Free Software Foundation; either version 2 ;of the License, or (at your option) any later version. ; ;This program is distributed in the hope that it will be useful, ;but WITHOUT ANY WARRANTY; without even the implied warranty of ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;GNU General Public License for more details. ; ;You should have received a copy of the GNU General Public License ;along with this program; if not, write to the Free Software ;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. CLS_MANUALUPDATE equ 0001h ;todo CLS_SHOWHIDDEN equ 0002h CLS_HIDEOFFLINE equ 0004h ;hides all offline users CLS_CHECKBOXES equ 0008h CLS_MULTICOLUMN equ 0010h ;not true multi-column, just for ignore/vis options CLS_HIDEEMPTYGROUPS equ 0020h ;note: this flag will be spontaneously removed if the 'new subgroup' menu item is clicked, for obvious reasons CLS_USEGROUPS equ 0040h CLS_NOHIDEOFFLINE equ 0080h ;overrides CLS_HIDEOFFLINE and the per-group hideoffline setting CLS_GREYALTERNATE equ 0100h ;make every other line slightly grey CLS_GROUPCHECKBOXES equ 0200h ;put checkboxes on groups too (managed by CLC) CLS_CONTACTLIST equ 0400h ;this control will be the main contact list (v. 0.3.4.3+ 2004/11/02) CLS_EX_DISABLEDRAGDROP equ 00000001h CLS_EX_EDITLABELS equ 00000002h CLS_EX_SHOWSELALWAYS equ 00000004h CLS_EX_TRACKSELECT equ 00000008h CLS_EX_SHOWGROUPCOUNTS equ 00000010h CLS_EX_DIVIDERONOFF equ 00000020h CLS_EX_HIDECOUNTSWHENEMPTY equ 00000040h CLS_EX_NOTRANSLUCENTSEL equ 00000080h CLS_EX_LINEWITHGROUPS equ 00000100h CLS_EX_QUICKSEARCHVISONLY equ 00000200h CLS_EX_SORTGROUPSALPHA equ 00000400h CLS_EX_NOSMOOTHSCROLLING equ 00000800h CLM_FIRST equ 1000h ;this is the same as LVM_FIRST CLM_LAST equ 1100h ;messages, compare with equivalent TVM_s in the MSDN CLM_ADDCONTACT equ (CLM_FIRST+0) ;wParam=hContact CLM_ADDGROUP equ (CLM_FIRST+1) ;wParam=hGroup CLM_AUTOREBUILD equ (CLM_FIRST+2) CLM_DELETEITEM equ (CLM_FIRST+3) ;wParam=hItem CLM_EDITLABEL equ (CLM_FIRST+4) ;wParam=hItem CLM_ENDEDITLABELNOW equ (CLM_FIRST+5) ;wParam=cancel, 0 to save CLM_ENSUREVISIBLE equ (CLM_FIRST+6) ;wParam=hItem, lParam=partialOk CLE_TOGGLE equ -1 CLE_COLLAPSE equ 0 CLE_EXPAND equ 1 CLE_INVALID equ FFFFh CLM_EXPAND equ (CLM_FIRST+7) ;wParam=hItem, lParam=CLE_ CLM_FINDCONTACT equ (CLM_FIRST+8) ;wParam=hContact, returns an hItem CLM_FINDGROUP equ (CLM_FIRST+9) ;wParam=hGroup, returns an hItem CLM_GETBKCOLOR equ (CLM_FIRST+10) ;returns a COLORREF CLM_GETCHECKMARK equ (CLM_FIRST+11) ;wParam=hItem, returns 1 or 0 CLM_GETCOUNT equ (CLM_FIRST+12) ;returns the total number of items CLM_GETEDITCONTROL equ (CLM_FIRST+13) ;returns the HWND, or NULL CLM_GETEXPAND equ (CLM_FIRST+14) ;wParam=hItem, returns a CLE_, CLE_INVALID if not a group CLM_GETEXTRACOLUMNS equ (CLM_FIRST+15) ;returns number of extra columns CLM_GETEXTRAIMAGE equ (CLM_FIRST+16) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF CLM_GETEXTRAIMAGELIST equ (CLM_FIRST+17) ;returns HIMAGELIST CLM_GETFONT equ (CLM_FIRST+18) ;wParam=fontId, see clm_setfont. returns hFont. CLM_GETINDENT equ (CLM_FIRST+19) ;wParam=new group indent CLM_GETISEARCHSTRING equ (CLM_FIRST+20) ;lParam=(char*)pszStr, max 120 bytes, returns number of chars in string CLM_GETITEMTEXT equ (CLM_FIRST+21) ;wParam=hItem, lParam=(char*)pszStr, max 120 bytes CLM_GETSCROLLTIME equ (CLM_FIRST+22) ;returns time in ms CLM_GETSELECTION equ (CLM_FIRST+23) ;returns hItem CLCHT_ABOVE equ 0001h ;above client area CLCHT_BELOW equ 0002h ;below client area CLCHT_TOLEFT equ 0004h ;left of client area CLCHT_TORIGHT equ 0008h ;right of client area CLCHT_NOWHERE equ 0010h ;in client area, not on an item CLCHT_ONITEMICON equ 0020h CLCHT_ONITEMCHECK equ 0040h CLCHT_ONITEMLABEL equ 0080h CLCHT_ONITEMINDENT equ 0100h ;to the left of an item icon CLCHT_ONITEMEXTRA equ 0200h ;on an extra icon, HIBYTE(HIWORD()) says which CLCHT_ONITEM equ 03E0h CLCHT_INLEFTMARGIN equ 0400h CLCHT_BELOWITEMS equ 0800h ;in client area but below last item CLM_HITTEST equ (CLM_FIRST+25) ;lParam=MAKELPARAM(x,y) (relative to control), wParam=(PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL CLM_SELECTITEM equ (CLM_FIRST+26) ;wParam=hItem CLB_TOPLEFT equ 0 CLB_STRETCHV equ 1 CLB_STRETCHH equ 2 ;and tile vertically CLB_STRETCH equ 3 CLBM_TYPE equ 00FFh CLBF_TILEH equ 1000h CLBF_TILEV equ 2000h CLBF_PROPORTIONAL equ 4000h CLBF_SCROLL equ 8000h CLM_SETBKBITMAP equ (CLM_FIRST+27) ;wParam=mode, lParam=hBitmap (don't delete it), NULL for none CLM_SETBKCOLOR equ (CLM_FIRST+28) ;wParam=a COLORREF, default is GetSysColor(COLOR_3DFACE) CLM_SETCHECKMARK equ (CLM_FIRST+29) ;wParam=hItem, lParam=1 or 0 CLM_SETEXTRACOLUMNS equ (CLM_FIRST+30) ;wParam=number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16) CLM_SETEXTRAIMAGE equ (CLM_FIRST+31) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFF is a blank CLM_SETEXTRAIMAGELIST equ (CLM_FIRST+32) ;lParam=HIMAGELIST FONTID_CONTACTS equ 0 FONTID_INVIS equ 1 FONTID_OFFLINE equ 2 FONTID_NOTONLIST equ 3 FONTID_GROUPS equ 4 FONTID_GROUPCOUNTS equ 5 FONTID_DIVIDER equ 6 FONTID_OFFINVIS equ 7 FONTID_STATUSMSG equ 8 FONTID_GROUPSCLOSED equ 9 FONTID_CONTACTSHOVER equ 10 FONTID_MAX equ 18 CLM_SETFONT equ (CLM_FIRST+33) ;wParam=hFont, lParam=MAKELPARAM(fRedraw,fontId) CLM_SETINDENT equ (CLM_FIRST+34) ;wParam=new indent, default is 3 pixels CLM_SETITEMTEXT equ (CLM_FIRST+35) ;wParam=hItem, lParam=(char*)pszNewText CLM_SETSCROLLTIME equ (CLM_FIRST+36) ;wParam=time in ms, default 200 CLM_SETHIDEEMPTYGROUPS equ (CLM_FIRST+38) ;wParam=TRUE/FALSE GREYF_UNFOCUS equ 80000000h MODEF_OFFLINE equ 40000000h ;and use the PF2_ #defines from m_protosvc.h CLM_SETGREYOUTFLAGS equ (CLM_FIRST+39) ;wParam=new flags CLM_GETHIDEOFFLINEROOT equ (CLM_FIRST+40) ;returns TRUE/FALSE CLM_SETHIDEOFFLINEROOT equ (CLM_FIRST+41) ;wParam=TRUE/FALSE CLM_SETUSEGROUPS equ (CLM_FIRST+42) ;wParam=TRUE/FALSE CLM_SETOFFLINEMODES equ (CLM_FIRST+43) ;for 'hide offline', wParam=PF2_ flags and MODEF_OFFLINE CLM_GETEXSTYLE equ (CLM_FIRST+44) ;returns CLS_EX_ flags CLM_SETEXSTYLE equ (CLM_FIRST+45) ;wParam=CLS_EX_ flags CLM_GETLEFTMARGIN equ (CLM_FIRST+46) ;returns count of pixels CLM_SETLEFTMARGIN equ (CLM_FIRST+47) ;wParam=pixels CLCINFOITEM struct cbSize dd ? pszText dd ? hParentGroup dd ? flags dd ? hIcon dd ? CLCINFOITEM ends CLCIIF_BELOWGROUPS equ 1 ;put it between groups and contacts, default is at top CLCIIF_BELOWCONTACTS equ 2 ;put it at the bottom CLCIIF_CHECKBOX equ 40h ;give this item a check box CLCIIF_GROUPFONT equ 80h ;draw the item using FONTID_GROUPS CLM_ADDINFOITEMA equ (CLM_FIRST+48) ;lParam=&cii, returns hItem CLM_ADDINFOITEMW equ (CLM_FIRST+53) ;lParam=&cii, returns hItem IFDEF _UNICODE CLM_ADDINFOITEM equ CLM_ADDINFOITEMW ELSE CLM_ADDINFOITEM equ CLM_ADDINFOITEMA ENDIF CLCIT_INVALID equ -1 CLCIT_GROUP equ 0 CLCIT_CONTACT equ 1 CLCIT_DIVIDER equ 2 CLCIT_INFO equ 3 CLM_GETITEMTYPE equ (CLM_FIRST+49) ;wParam=hItem, returns a CLCIT_ CLGN_ROOT equ 0 CLGN_CHILD equ 1 CLGN_PARENT equ 2 CLGN_NEXT equ 3 CLGN_PREVIOUS equ 4 CLGN_NEXTCONTACT equ 5 CLGN_PREVIOUSCONTACT equ 6 CLGN_NEXTGROUP equ 7 CLGN_PREVIOUSGROUP equ 8 CLM_GETNEXTITEM equ (CLM_FIRST+50) ;wParam=flag, lParam=hItem, returns an hItem CLM_GETTEXTCOLOR equ (CLM_FIRST+51) ;wParam=FONTID_, returns COLORREF CLM_SETTEXTCOLOR equ (CLM_FIRST+52) ;wParam=FONTID_, lParam=COLORREF ;notifications (most are omitted because the control processes everything) CLNF_ISGROUP equ 1 CLNF_ISINFO equ 2 NMCLISTCONTROL struct hdr NMHDR <> hItem dd ? action dd ? iColumn dd ? ;-1 if not on an extra column flags dd ? pt POINT <> NMCLISTCONTROL ends CLN_FIRST equ (0-100) CLN_EXPANDED equ (CLN_FIRST-0) ;hItem=hGroup, action=CLE_* CLN_LISTREBUILT equ (CLN_FIRST-1) CLN_ITEMCHECKED equ (CLN_FIRST-2) ;todo //hItem,action,flags valid CLN_DRAGGING equ (CLN_FIRST-3) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed CLN_DROPPED equ (CLN_FIRST-4) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed CLN_LISTSIZECHANGE equ (CLN_FIRST-5) ;pt.y valid. the vertical height of the visible items in the list has changed. CLN_OPTIONSCHANGED equ (CLN_FIRST-6) ;nothing valid. If you set some extended options they have been overwritten and should be re-set CLN_DRAGSTOP equ (CLN_FIRST-7) ;hItem,flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed CLN_NEWCONTACT equ (CLN_FIRST-8) ;hItem,flags valid. sent when a new contact is added without a full list rebuild CLN_CONTACTMOVED equ (CLN_FIRST-9) ;hItem,flags valid. sent when contact is moved without a full list rebuild CLN_CHECKCHANGED equ (CLN_FIRST-10) ;hItem,flags valid. sent when any check mark is changed, but only for one change if there are many ;NM_CLICK //hItem,iColumn,pt,flags valid ;NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing