本文整理汇总了C++中LoadSkinnedIcon函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadSkinnedIcon函数的具体用法?C++ LoadSkinnedIcon怎么用?C++ LoadSkinnedIcon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadSkinnedIcon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadModules
int LoadModules(void)
{
HookEvent(ME_OPT_INITIALISE,OptInitialise);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SmsRebuildContactMenu);
HookEvent(ME_PROTO_ACK,handleAckSMS);
HookEvent(ME_DB_EVENT_ADDED,handleNewMessage);
HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
char szServiceFunction[MAX_PATH];
mir_snprintf(szServiceFunction,sizeof(szServiceFunction),"%s%s",PROTOCOL_NAMEA,SMS_SEND);
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 300050000;
mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
mi.ptszName = SMS_SEND_STR;
mi.pszService = szServiceFunction;
mi.flags = CMIF_TCHAR;
Menu_AddMainMenuItem(&mi);
mi.position = -2000070000;
mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
mi.ptszName = SMS_SEND_CM_STR;
mi.pszService = szServiceFunction;
mi.flags = CMIF_TCHAR;
ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
SkinAddNewSoundEx("RecvSMSMsg",PROTOCOL_NAMEA,LPGEN("Incoming SMS Message"));
SkinAddNewSoundEx("RecvSMSConfirmation",PROTOCOL_NAMEA,LPGEN("Incoming SMS Confirmation"));
RefreshAccountList(NULL,NULL);
RestoreUnreadMessageAlerts();
return 0;
}
示例2: UpdateIcon
CSrmmProxyWindow::CSrmmProxyWindow(HANDLE hContact, HWND hwndWindow, HWND hwndParent)
{
m_hContact = hContact;
m_hwndWindow = hwndWindow;
m_hwndParent = hwndParent;
m_hbmpPreview = NULL;
m_refreshPreview = true;
m_bActive = false;
m_bUnread = false;
m_bTyping = false;
UpdateIcon();
SetWindowText(hwnd(), (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)m_hContact, GCDNF_TCHAR));
SetTimer(1, 1000);
SetEventHook(ME_DB_EVENT_ADDED, &CSrmmProxyWindow::OnDbEventAdded);
SetEventHook(ME_DB_CONTACT_SETTINGCHANGED, &CSrmmProxyWindow::OnDbSettingChanged);
SetEventHook(ME_AV_AVATARCHANGED, &CSrmmProxyWindow::OnAvatarChanged);
SetEventHook(ME_PROTO_CONTACTISTYPING, &CSrmmProxyWindow::OnContactTyping);
AddButton(LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS), TranslateT("User Details"), 1, THBF_DISMISSONCLICK);
AddButton(LoadSkinnedIcon(SKINICON_OTHER_HISTORY), TranslateT("History"), 2, THBF_DISMISSONCLICK);
AddButton(LoadSkinnedIcon(SKINICON_EVENT_FILE), TranslateT("File"), 3, THBF_DISMISSONCLICK);
UpdateButtons(g_pTaskbarList);
}
示例3: CreateImageList
void TSAPI CreateImageList(BOOL bInitial)
{
int cxIcon = GetSystemMetrics(SM_CXSMICON);
int cyIcon = GetSystemMetrics(SM_CYSMICON);
/*
* the imagelist is now a fake. It is still needed to provide the tab control with a
* image list handle. This will make sure that the tab control will reserve space for
* an icon on each tab. This is a blank and empty icon
*/
if (bInitial) {
PluginConfig.g_hImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 2, 0);
HICON hIcon = CreateIcon(g_hInst, 16, 16, 1, 4, NULL, NULL);
ImageList_AddIcon(PluginConfig.g_hImageList, hIcon);
DestroyIcon(hIcon);
}
PluginConfig.g_IconFileEvent = LoadSkinnedIcon(SKINICON_EVENT_FILE);
PluginConfig.g_IconMsgEvent = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
PluginConfig.g_IconMsgEventBig = LoadSkinnedIconBig(SKINICON_EVENT_MESSAGE);
if ((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconMsgEventBig)
PluginConfig.g_IconMsgEventBig = 0;
PluginConfig.g_IconTypingEventBig = LoadSkinnedIconBig(SKINICON_OTHER_TYPING);
if ((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconTypingEventBig)
PluginConfig.g_IconTypingEventBig = 0;
PluginConfig.g_IconSend = PluginConfig.g_buttonBarIcons[9];
PluginConfig.g_IconTypingEvent = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
}
示例4: CListIconsChanged
int CListIconsChanged(WPARAM wParam,LPARAM lParam)
{
int i,j;
for(i=0;i<sizeof(statusModeList)/sizeof(statusModeList[0]);i++)
ImageList_ReplaceIcon(hCListImages,i+1,LoadSkinnedIcon(skinIconStatusList[i]));
ImageList_ReplaceIcon(hCListImages,IMAGE_GROUPOPEN, LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN));
ImageList_ReplaceIcon(hCListImages,IMAGE_GROUPSHUT, LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT));
for(i=0;i<protoIconIndexCount;i++)
for(j=0;j<sizeof(statusModeList)/sizeof(statusModeList[0]);j++)
ImageList_ReplaceIcon(hCListImages,protoIconIndex[i].iIconBase+j,LoadSkinnedProtoIcon(protoIconIndex[i].szProto,statusModeList[j]));
TrayIconIconsChanged();
InvalidateRectZ((HWND)CallService(MS_CLUI_GETHWND,0,0),NULL,TRUE);
return 0;
}
示例5: ShowPopupPreview
int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
{
case POPUP_DEFAULT:
ppdp.colorText = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_APPROVED_FOREGROUND,CPM_GETCOLOUR,0,0);
ppdp.colorBack = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_APPROVED_BACKGROUND,CPM_GETCOLOUR,0,0);
break;
case POPUP_BLOCKED:
ppdp.colorText = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_BLOCKED_FOREGROUND,CPM_GETCOLOUR,0,0);
ppdp.colorBack = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_BLOCKED_BACKGROUND,CPM_GETCOLOUR,0,0);
ppdp.iSeconds = GetDlgItemInt(optDlg, IDC_OPT_POPUPS_BLOCKED_TIMEOUT, NULL, TRUE);
ppdp.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_DELETE);
break;
case POPUP_APPROVED:
ppdp.colorText = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_APPROVED_FOREGROUND,CPM_GETCOLOUR,0,0);
ppdp.colorBack = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_APPROVED_BACKGROUND,CPM_GETCOLOUR,0,0);
ppdp.iSeconds = GetDlgItemInt(optDlg, IDC_OPT_POPUPS_APPROVED_TIMEOUT, NULL, TRUE);
ppdp.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_ADDCONTACT);
break;
case POPUP_CHALLENGE:
ppdp.colorText = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_CHALLENGE_FOREGROUND,CPM_GETCOLOUR,0,0);
ppdp.colorBack = SendDlgItemMessage(optDlg,IDC_OPT_POPUPS_CHALLENGE_BACKGROUND,CPM_GETCOLOUR,0,0);
ppdp.iSeconds = GetDlgItemInt(optDlg, IDC_OPT_POPUPS_CHALLENGE_TIMEOUT, NULL, TRUE);
ppdp.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
break;
}
if (SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_WINDOWS_COLORS, BM_GETCHECK, 0, 0)) {
ppdp.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppdp.colorBack = GetSysColor(COLOR_WINDOW);
}
if (SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_COLORS, BM_GETCHECK, 0, 0)) {
ppdp.colorText = NULL;
ppdp.colorBack = NULL;
}
if (ppdp.iSeconds < 1)
ppdp.iSeconds = -1;
if (SendDlgItemMessage(optDlg, IDC_OPT_POPUPS_DEFAULT_TIMEOUT, BM_GETCHECK, 0, 0) || popupType == POPUP_DEFAULT)
ppdp.iSeconds = 0;
ppdp.lchContact = NULL;
mir_sntprintf(ppdp.lptzContactName, MAX_CONTACTNAME, _T("%s"), (line1)?line1:_T(PLUGIN_NAME));
if (line2)
mir_sntprintf(ppdp.lptzText, MAX_SECONDLINE, _T("%s"), line2);
return PUAddPopupT(&ppdp);
}
示例6: MM_IconsChanged
void MM_IconsChanged(void)
{
MODULEINFO *pTemp = m_ModList, *pLast = NULL;
ImageList_ReplaceIcon(hIconsList, 0, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE));
ImageList_ReplaceIcon(hIconsList, 1, LoadIconEx( "overlay", FALSE ));
while (pTemp != NULL)
{
pTemp->OnlineIconIndex = ImageList_ReplaceIcon(hIconsList, pTemp->OnlineIconIndex, LoadSkinnedProtoIcon(pTemp->pszModule, ID_STATUS_ONLINE));
pTemp->OfflineIconIndex = ImageList_ReplaceIcon(hIconsList, pTemp->OfflineIconIndex, LoadSkinnedProtoIcon(pTemp->pszModule, ID_STATUS_OFFLINE));
if (pTemp->hOfflineIcon)
DestroyIcon(pTemp->hOfflineIcon);
if (pTemp->hOnlineIcon)
DestroyIcon(pTemp->hOnlineIcon);
if (pTemp->hOnlineTalkIcon)
DestroyIcon(pTemp->hOnlineTalkIcon);
if (pTemp->hOfflineTalkIcon)
DestroyIcon(pTemp->hOfflineTalkIcon);
pTemp->hOfflineIcon = ImageList_GetIcon(hIconsList, pTemp->OfflineIconIndex, ILD_TRANSPARENT);
pTemp->hOnlineIcon = ImageList_GetIcon(hIconsList, pTemp->OnlineIconIndex, ILD_TRANSPARENT);
pTemp->hOnlineTalkIcon = ImageList_GetIcon(hIconsList, pTemp->OnlineIconIndex, ILD_TRANSPARENT|INDEXTOOVERLAYMASK(1));
ImageList_ReplaceIcon(hIconsList, pTemp->OnlineIconIndex+1, pTemp->hOnlineTalkIcon);
pTemp->hOfflineTalkIcon = ImageList_GetIcon(hIconsList, pTemp->OfflineIconIndex, ILD_TRANSPARENT|INDEXTOOVERLAYMASK(1));
ImageList_ReplaceIcon(hIconsList, pTemp->OfflineIconIndex+1, pTemp->hOfflineTalkIcon);
pLast = pTemp;
pTemp = pTemp->next;
}
return;
}
示例7: ShowPopup
// Show an popup
void ShowPopup(const char *title, const char *description, int type)
{
if (!ServiceExists(MS_POPUP_ADDPOPUP) || !EnablePopups)
return;
// Make popup
POPUPDATA ppd = { 0 };
ppd.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
strncpy(ppd.lpzContactName, title == NULL ? "Modern Contact List" : title, SIZEOF(ppd.lpzContactName)-1);
ppd.lpzContactName[SIZEOF(ppd.lpzContactName)-1] = '\0';
if (description != NULL) {
strncpy(ppd.lpzText, description, SIZEOF(ppd.lpzText)-1);
ppd.lpzText[SIZEOF(ppd.lpzText)-1] = '\0';
}
if (type != POPUP_TYPE_NORMAL && type != POPUP_TYPE_TEST) {
ppd.colorBack = -1;
ppd.colorText = RGB(255,255,255);
}
ppd.PluginWindowProc = DumbPopupDlgProc;
PUAddPopup(&ppd);
}
示例8: LoadActions
// interface
void LoadActions()
{
POPUPACTION actions[] =
{
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_REPLY,0), "General/Quick reply", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_MESS,0), "General/Send message", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_INFO,0), "General/User details", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_MENU,0), "General/Contact menu", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_ADD,0), "General/Add permanently", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_PIN,0), "General/Pin popup", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE,0), "General/Dismiss popup", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_COPY,0), "General/Copy to clipboard", 0},
//remove popup action
#if defined(_DEBUG)
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_POPUP_ON,0), "Popup Plus/Test action", PAF_ENABLED},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE,0), "Popup Plus/Second test action", 0},
{ sizeof(POPUPACTION), LoadSkinnedIcon(SKINICON_OTHER_MIRANDA), "Popup Plus/One more action", PAF_ENABLED},
#endif
};
for (int i = 0; i < SIZEOF(actions); ++i)
RegisterAction(&actions[i]);
}
示例9: CListModernOptInit
int CListModernOptInit(WPARAM wParam, LPARAM lParam)
{
static int iBoldControls[] =
{
IDC_TXT_TITLE1, IDC_TXT_TITLE2,
MODERNOPT_CTRL_LAST
};
MODERNOPTOBJECT obj = {0};
obj.cbSize = sizeof(obj);
obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE;
obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_CLIST;
obj.iType = MODERNOPT_TYPE_SECTIONPAGE;
obj.iBoldControls = iBoldControls;
obj.lpzClassicGroup = "Contact List";
obj.lpzClassicPage = "List";
obj.lpzHelpUrl = "http://wiki.miranda-im.org/";
obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_CLIST);
obj.pfnDlgProc = DlgProcGenOpts;
CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj);
return 0;
}
示例10: SplitmsgModulesLoaded
static int SplitmsgModulesLoaded(WPARAM wParam, LPARAM lParam)
{
CLISTMENUITEM mi;
PROTOCOLDESCRIPTOR **protocol;
int protoCount, i;
RegisterIcoLibIcons();
RegisterFontServiceFonts();
LoadGlobalIcons();
LoadMsgLogIcons();
LoadProtocolIcons();
ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = -2000090000;
mi.flags = 0;
mi.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
mi.pszName = Translate("&Message");
mi.pszService = MS_MSG_SENDMESSAGE;
CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & protoCount, (LPARAM) & protocol);
for (i = 0; i < protoCount; i++) {
if (protocol[i]->type != PROTOTYPE_PROTOCOL)
continue;
if (CallProtoService(protocol[i]->szName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) {
mi.pszContactOwner = protocol[i]->szName;
hMsgMenuItem = realloc(hMsgMenuItem, (hMsgMenuItemCount + 1) * sizeof(HANDLE));
hMsgMenuItem[hMsgMenuItemCount++] = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi);
}
}
HookEvent(ME_CLIST_DOUBLECLICKED, SendMessageCommand);
HookEvent(ME_SMILEYADD_OPTIONSCHANGED, SmileySettingsChanged);
HookEvent(ME_IEVIEW_OPTIONSCHANGED, SmileySettingsChanged);
RestoreUnreadMessageAlerts();
return 0;
}
示例11: WindowSetIcon
void CJabberDlgBookmarks::OnInitDialog()
{
CSuper::OnInitDialog();
WindowSetIcon(m_hwnd, m_proto, "bookmarks");
m_btnAdd.Disable();
m_btnEdit.Disable();
m_btnRemove.Disable();
m_lvBookmarks.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP | LVS_EX_DOUBLEBUFFER);
HIMAGELIST hIml = m_lvBookmarks.CreateImageList(LVSIL_SMALL);
ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("group"));
ImageList_AddIcon_Icolib(hIml, LoadSkinnedIcon(SKINICON_EVENT_URL));
m_lvBookmarks.AddColumn(0, TranslateT("Bookmark Name"), m_proto->getWord("bookmarksWnd_cx0", 120));
m_lvBookmarks.AddColumn(1, TranslateT("Address (JID or URL)"), m_proto->getWord("bookmarksWnd_cx1", 210));
m_lvBookmarks.AddColumn(2, TranslateT("Nickname"), m_proto->getWord("bookmarksWnd_cx2", 90));
m_lvBookmarks.EnableGroupView(TRUE);
m_lvBookmarks.AddGroup(0, TranslateT("Conferences"));
m_lvBookmarks.AddGroup(1, TranslateT("Links"));
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "bookmarksWnd_");
}
示例12: _DebugPopup
int _DebugPopup(HANDLE hContact, const char *fmt, ...)
{
POPUPDATA ppd;
va_list va;
char debug[1024];
int ibsize = 1023;
va_start(va, fmt);
_vsnprintf(debug, ibsize, fmt, va);
if(CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
ZeroMemory((void *)&ppd, sizeof(ppd));
ppd.lchContact = hContact;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
if(hContact != 0)
strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME);
else
strncpy(ppd.lpzContactName, "Message", MAX_CONTACTNAME);
strcpy(ppd.lpzText, "Debug (CListN+): ");
strncat(ppd.lpzText, debug, MAX_SECONDLINE - 20);
ppd.colorText = RGB(0,0,0);
ppd.colorBack = RGB(255,0,255);
CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
}
return 0;
}
示例13: ShowPopup
int ShowPopup(HANDLE hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
{
case POPUP_DEFAULT:
ppdp.colorText = _getOptD("PopupApprovedForeground", defaultPopupApprovedForeground);
ppdp.colorBack = _getOptD("PopupApprovedBackground", defaultPopupApprovedBackground);
break;
case POPUP_BLOCKED:
ppdp.colorText = _getOptD("PopupBlockedForeground", defaultPopupBlockedForeground);
ppdp.colorBack = _getOptD("PopupBlockedBackground", defaultPopupBlockedBackground);
ppdp.iSeconds = _getOptD("PopupBlockedTimeout", defaultPopupBlockedTimeout);
ppdp.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_DELETE);
break;
case POPUP_APPROVED:
ppdp.colorText = _getOptD("PopupApprovedForeground", defaultPopupApprovedForeground);
ppdp.colorBack = _getOptD("PopupApprovedBackground", defaultPopupApprovedBackground);
ppdp.iSeconds = _getOptD("PopupApprovedTimeout", defaultPopupApprovedTimeout);
ppdp.lchIcon = LoadSkinnedIcon(SKINICON_OTHER_ADDCONTACT);
break;
case POPUP_CHALLENGE:
ppdp.colorText = _getOptD("PopupChallengeForeground", defaultPopupChallengeForeground);
ppdp.colorBack = _getOptD("PopupChallengeBackground", defaultPopupChallengeBackground);
ppdp.iSeconds = _getOptD("PopupChallengeTimeout", defaultPopupChallengeTimeout);
ppdp.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
break;
}
if (_getOptB("PopupWindowsColors", defaultPopupWindowsColors)) {
ppdp.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppdp.colorBack = GetSysColor(COLOR_WINDOW);
}
if (_getOptB("PopupDefaultColors", defaultPopupDefaultColors)) {
ppdp.colorText = NULL;
ppdp.colorBack = NULL;
}
if (ppdp.iSeconds < 1)
ppdp.iSeconds = -1;
if (_getOptB("PopupDefaultTimeout", defaultPopupDefaultTimeout) || popupType == POPUP_DEFAULT)
ppdp.iSeconds = 0;
ppdp.lchContact = hContact;
mir_sntprintf(ppdp.lptzContactName, MAX_CONTACTNAME, _T("%s"), (line1)?line1:_T(PLUGIN_NAME));
if (line2)
mir_sntprintf(ppdp.lptzText, MAX_SECONDLINE, _T("%s"), line2);
return PUAddPopupT(&ppdp);
}
示例14: InitOptions
void InitOptions()
{
HookEvent(ME_OPT_INITIALISE, OptInit);
// an icon for preview popups
hPopupIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
LoadOptions();
}
示例15: MessageEventAdded
static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
{
CLISTEVENT cle;
DBEVENTINFO dbei;
char *contactName;
char toolTip[256];
HWND hwnd;
ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, lParam, (LPARAM) & dbei);
hwnd = WindowList_Find(g_dat->hMessageWindowList, (HANDLE) wParam);
if (hwnd) {
SendMessage(hwnd, HM_DBEVENTADDED, wParam, lParam);
}
if (dbei.flags & DBEF_SENT || dbei.eventType != EVENTTYPE_MESSAGE)
return 0;
if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
return 0;
CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, (LPARAM) 1);
/* does a window for the contact exist? */
if (hwnd) {
return 0;
}
/* new message */
SkinPlaySound("AlertMsg");
if (DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP)) {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) wParam, 0);
if (szProto && (g_dat->openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) {
struct NewMessageWindowLParam newData = { 0 };
newData.hContact = (HANDLE) wParam;
if (g_dat->hParent == NULL || !(g_dat->flags & SMF_USETABS)) {
g_dat->hParent = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGWIN), NULL, DlgProcParentWindow, (LPARAM) & newData);
}
newData.flags = NMWLP_INCOMING;
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), g_dat->hParent, DlgProcMessage, (LPARAM) & newData);
return 0;
}
}
ZeroMemory(&cle, sizeof(cle));
cle.cbSize = sizeof(cle);
cle.hContact = (HANDLE) wParam;
cle.hDbEvent = (HANDLE) lParam;
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
contactName = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, 0);
mir_snprintf(toolTip, sizeof(toolTip), Translate("Message from %s"), contactName);
cle.pszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM) & cle);
return 0;
}