当前位置: 首页>>代码示例>>C++>>正文


C++ Shell_NotifyIcon函数代码示例

本文整理汇总了C++中Shell_NotifyIcon函数的典型用法代码示例。如果您正苦于以下问题:C++ Shell_NotifyIcon函数的具体用法?C++ Shell_NotifyIcon怎么用?C++ Shell_NotifyIcon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Shell_NotifyIcon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ZeroMemory

BOOL CEpgTimerTaskDlg::ChgTipsTaskBar(HWND hWnd, UINT uiID, HICON hIcon, CString strTips)
{ 
	BOOL bRet;
	NOTIFYICONDATA stData;
	ZeroMemory(&stData, sizeof(NOTIFYICONDATA));

	stData.cbSize = sizeof(NOTIFYICONDATA); 
	stData.hWnd = hWnd; 
	stData.uID = uiID; 
	stData.hIcon = hIcon; 
	stData.uFlags = NIF_ICON | NIF_TIP; 

	if( strTips.IsEmpty() == false ){
		wcsncpy_s(stData.szTip, sizeof(stData.szTip), strTips.GetBuffer(0), sizeof(stData.szTip) );
	}
 
	bRet = Shell_NotifyIcon(NIM_MODIFY, &stData); 
 
	return bRet; 
}
开发者ID:ACUVE,项目名称:EDCB,代码行数:20,代码来源:EpgTimerTaskDlg.cpp

示例2: Shell_NotifyIcon

BOOL CSystemTray::HideIcon()
{
    if (!m_bEnabled || m_bRemoved || m_bHidden)
        return TRUE;

#ifdef SYSTEMTRAY_USEW2K
    if (m_bWin2K)
    {
        m_tnd.uFlags = NIF_STATE;
        m_tnd.dwState = NIS_HIDDEN;
        m_tnd.dwStateMask = NIS_HIDDEN;

        m_bHidden = Shell_NotifyIcon( NIM_MODIFY, &m_tnd);
    }
    else
#endif
        RemoveIcon();

    return (m_bHidden == TRUE);
}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:20,代码来源:SystemTray.cpp

示例3: Shell_NotifyIcon

BOOL CTrayDialog::TrayUpdate()
{
    BOOL bSuccess = FALSE;
    if (m_bTrayIconVisible)
    {
        bSuccess = Shell_NotifyIcon(NIM_MODIFY, &m_nidIconData);
        if (!bSuccess) {
			//ASSERT(0);
            return FALSE; // don't delete 'm_hPrevIconDelete' because it's still attached to the tray
        }
    }
   
    if (m_hPrevIconDelete != NULL)
    {
        VERIFY( ::DestroyIcon(m_hPrevIconDelete) );
        m_hPrevIconDelete = NULL;
    }        
   
	return bSuccess;
} 
开发者ID:LjApps,项目名称:eMule-VeryCD,代码行数:20,代码来源:TrayDialog.cpp

示例4: openMonitorIcon

/*
    Can be called multiple times 
 */
static int openMonitorIcon()
{
    NOTIFYICONDATA  data;
    HICON           iconHandle;
    HBITMAP         go, stop;
    static int      doOnce = 0;
    int             rc;

    if (app->monitorMenu == NULL) {
        app->monitorMenu = LoadMenu(app->appInst, "monitorMenu");
        if (! app->monitorMenu) {
            mprError("Can't locate monitorMenu");
            return MPR_ERR_CANT_OPEN;
        }
    }
    if (app->subMenu == NULL) {
        app->subMenu = GetSubMenu(app->monitorMenu, 0);
        go = LoadBitmap(app->appInst, MAKEINTRESOURCE(IDB_GO));
        rc = GetLastError();
        stop = LoadBitmap(app->appInst, MAKEINTRESOURCE(IDB_STOP));
        SetMenuItemBitmaps(app->subMenu, MA_MENU_STATUS, MF_BYCOMMAND, stop, go);
    }
    iconHandle = (HICON) LoadImage(app->appInst, APPWEB_ICON, IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
    if (iconHandle == 0) {
        mprError("Can't load icon %s", APPWEB_ICON);
        return MPR_ERR_CANT_INITIALIZE;
    }
    data.uID = APPWEB_MONITOR_ID;
    data.hWnd = app->appHwnd;
    data.hIcon = iconHandle;
    data.cbSize = sizeof(NOTIFYICONDATA);
    data.uCallbackMessage = APPWEB_MONITOR_MESSAGE;
    data.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE;

    scopy(data.szTip, sizeof(data.szTip), mprGetAppTitle());
    Shell_NotifyIcon(NIM_ADD, &data);
    if (iconHandle) {
        DestroyIcon(iconHandle);
    }
    return 0;
}
开发者ID:ni-webtech,项目名称:appweb-4,代码行数:44,代码来源:appwebMonitor.c

示例5: ModifyStatusIcon

//-------------------------------------------------
void ModifyStatusIcon()
{
    NOTIFYICONDATA tnid; 

    tnid.cbSize = sizeof(NOTIFYICONDATA);
    tnid.hWnd = pShMem->hMainDlg;
	tnid.uID = ID_VIETKEY_ICON;
	if (pShMem->vietKey) {
		tnid.hIcon = pShMem->hVietIcon;
		lstrcpy(tnid.szTip,_TEXT("Click to turn off Vietnamese mode"));

	} else {
		tnid.hIcon = pShMem->hEnIcon;
		lstrcpy(tnid.szTip,_TEXT("Click to turn on Vietnamese mode"));
	}
    tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; 
    tnid.uCallbackMessage = pShMem->iconMsgId;
	Shell_NotifyIcon(pShMem->iconShown?NIM_MODIFY:NIM_ADD, &tnid);
	pShMem->iconShown = 1;
} 
开发者ID:Phonglu252,项目名称:UniKey362,代码行数:21,代码来源:keyhook.cpp

示例6: wcsncpy_s

int CH3CDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  在此添加您专用的创建代码

	m_threadInfo.hWnd=this->m_hWnd;
 
	tnd.cbSize=NOTIFYICONDATA_V2_SIZE; 
	tnd.hWnd=this->m_hWnd; 
	tnd.uID=IDR_MAINFRAME; 
	tnd.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP; 
	tnd.uCallbackMessage=WM_TRAY;
	tnd.hIcon=LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_DISCON)); 
	wcsncpy_s(tnd.szTip, _countof(tnd.szTip), _T("H3C 802.1x认证"), 128);
	Shell_NotifyIcon(NIM_ADD,&tnd);

	return 0;
}
开发者ID:sunjw,项目名称:h3c_nuaa,代码行数:20,代码来源:H3CDlg.cpp

示例7: ZeroMemory

BOOL CEdenDlg::ChgTipsTaskBar(HWND wnd, UINT id, HICON icon, CString tips)
{ 
	BOOL ret=TRUE;
	NOTIFYICONDATA data;
	ZeroMemory(&data, sizeof(NOTIFYICONDATA));

	data.cbSize = sizeof(NOTIFYICONDATA); 
	data.hWnd = wnd; 
	data.uID = id; 
	data.hIcon = icon; 
	data.uFlags = NIF_ICON | NIF_TIP; 

	if( tips.IsEmpty() == false ){
		wcsncpy_s(data.szTip, sizeof(data.szTip), tips.GetBuffer(0), sizeof(data.szTip) );
	}
 
	ret = Shell_NotifyIcon(NIM_MODIFY, &data); 
 
	return ret; 
}
开发者ID:Z774M,项目名称:EDEN,代码行数:20,代码来源:EdenDlg.cpp

示例8: toggleCursorClipping

VOID toggleCursorClipping() 
{
	if (isClippingEnabled) 
	{
		// Freeing the cursor
		ClipCursor(NULL);

		// Removing the systray tooltip
		notificationIconData.szTip[0] = '\0';

		// Changing systray icon
		notificationIconData.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_INACTIVE));

	}
	else
	{
		HWND hWnd = GetForegroundWindow();

		if (hWnd != NULL) {
			// Clipping cursor
			GetWindowText(hWnd, clippedWindowName, MAX_CLIPPED_WINDOW_NAME_SIZE);
			clipCursorToWindow(hWnd);
			
			// Changing the systray tooltip
			_snwprintf_s(
				notificationIconData.szTip,
				sizeof(notificationIconData.szTip),
				L"Cursor clipped to: %s",
				clippedWindowName);

			// Changing systray icon
			notificationIconData.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ACTIVE));

		}

	}


	Shell_NotifyIcon(NIM_MODIFY, &notificationIconData);
	isClippingEnabled = !isClippingEnabled;
}
开发者ID:abrioy,项目名称:CursorClip,代码行数:41,代码来源:CursorClip.cpp

示例9: TRACE0

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	NOTIFYICONDATA &tnd = m_notifyData;
	tnd.cbSize=sizeof(NOTIFYICONDATA);
	tnd.hWnd=this->m_hWnd;
	tnd.uID=IDR_MAINFRAME;
	tnd.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP;
	tnd.uCallbackMessage=WM_MYSYSTRAYNOTIFY;
	tnd.hIcon=LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME));
	strcpy(tnd.szTip,"菩提字幕");//图标提示为"测试程序"
	BOOL rt = Shell_NotifyIcon(NIM_ADD,&tnd);//向任务栏添加图标
	if(!rt)
		TRACE0("Add systray icon failed!");

	return 0;
}
开发者ID:fengct,项目名称:zimu,代码行数:41,代码来源:MainFrm.cpp

示例10: openTrayIcon

static int openTrayIcon()
{
	NOTIFYICONDATA	data;
	HICON			iconHandle;
	static int		doOnce = 0;


	if (trayMenu == NULL) {
		trayMenu = LoadMenu(appInst, "trayMenu");
		if (! trayMenu) {
			mprError(MPR_L, MPR_LOG, "Can't locate trayMenu");
			return MPR_ERR_CANT_OPEN;
		}
	}
	if (subMenu == NULL) {
		subMenu = GetSubMenu(trayMenu, 0);
	}

	iconHandle = (HICON) LoadImage(appInst, APPWEB_ICON, IMAGE_ICON, 0, 0,
		LR_LOADFROMFILE | LR_DEFAULTSIZE);
	if (iconHandle == 0) {
		mprError(MPR_L, MPR_LOG, "Can't load icon %s", APPWEB_ICON);
		return MPR_ERR_CANT_INITIALIZE;
	}

	data.uID = APPWEB_TRAY_ID;
	data.hWnd = appHwnd;
	data.hIcon = iconHandle;
	data.cbSize = sizeof(NOTIFYICONDATA);
	data.uCallbackMessage = APPWEB_TRAY_MESSAGE;
	data.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE;

	mprStrcpy(data.szTip, sizeof(data.szTip), mp->getAppTitle());

	Shell_NotifyIcon(NIM_ADD, &data);

	if (iconHandle) {
		DestroyIcon(iconHandle);
	}
	return 0;
}
开发者ID:embedthis,项目名称:appweb-2,代码行数:41,代码来源:appweb.cpp

示例11: sizeof

NS_IMETHODIMP
otSystrayWin::Hide()
{
  nsresult rv = otSystrayBase::Hide();

  if (NS_SUCCEEDED(rv) && mNid) {
    NOTIFYICONDATA nid;

    nid.cbSize = sizeof(nid);
    nid.hWnd = GetHWND();
    nid.uFlags = 0;
    nid.uID = mNid;

    Shell_NotifyIcon(NIM_DELETE, &nid);

    systrays[mNid-100] = 0;
    mNid = 0;
  }

  return rv;
}
开发者ID:GYGit,项目名称:oneteam,代码行数:21,代码来源:otSystrayWin.cpp

示例12: ZeroMemory

BOOL CEpgDataCap_BonDlg::AddTaskBar(HWND wnd, UINT msg, UINT id, HICON icon, CString tips)
{ 
	BOOL ret=TRUE;
	NOTIFYICONDATA data;
	ZeroMemory(&data, sizeof(NOTIFYICONDATA));

	data.cbSize = sizeof(NOTIFYICONDATA); 
	data.hWnd = wnd; 
	data.uID = id; 
	data.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; 
	data.uCallbackMessage = msg; 
	data.hIcon = icon; 

	if( tips.IsEmpty() == false ){
		wcsncpy_s(data.szTip, sizeof(data.szTip), tips.GetBuffer(0), sizeof(data.szTip) );
	}
 
	ret = Shell_NotifyIcon(NIM_ADD, &data);
  
	return ret; 
}
开发者ID:ACUVE,项目名称:EDCB,代码行数:21,代码来源:EpgDataCap_BonDlg.cpp

示例13: ShowTrayIcon

BOOL ShowTrayIcon()
{
	NOTIFYICONDATA nid;
	ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
	nid.cbSize = (DWORD)sizeof(NOTIFYICONDATA);
	nid.hWnd   = hWnd;
	nid.uID	   = NID_UID;
	nid.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
	nid.dwInfoFlags=NIIF_INFO;
	nid.uCallbackMessage = WM_TASKBARNOTIFY;	
	nid.hIcon = LoadIcon(hInst, (LPCTSTR)IDI_SMALL);
	lstrcpy(nid.szTip, szTooltip);
    if (lstrlen(szBalloon) > 0)
	{
		nid.uFlags |= NIF_INFO;
		lstrcpy(nid.szInfo, szBalloon);
		lstrcpy(nid.szInfoTitle,szTitle);
	}
	Shell_NotifyIcon(NIM_ADD, &nid);
	return TRUE;
}
开发者ID:ky0ncheng,项目名称:taskbar,代码行数:21,代码来源:taskbar.cpp

示例14: channelPopup

//-----------------------------
void channelPopup(const char *title, const char *msg, bool isPopup = true)
{
    String both;

    if (*title == '\0') return;
    both.append(msg);
    both.append(" (");
    both.append(title);
    both.append(")");

    trayIcon.uFlags = NIF_ICON|NIF_TIP;
    strncpy(trayIcon.szTip, both.cstr(),sizeof(trayIcon.szTip)-1);
    trayIcon.szTip[sizeof(trayIcon.szTip)-1]=0;

    if (isPopup) trayIcon.uFlags |= 16;
    trayIcon.uTimeoutOrVersion = 10000;
    strncpy(trayIcon.szInfo,msg,sizeof(trayIcon.szInfo)-1);
    strncpy(trayIcon.szInfoTitle,title,sizeof(trayIcon.szInfoTitle)-1);

    Shell_NotifyIcon(NIM_MODIFY, (NOTIFYICONDATA*)&trayIcon);
}
开发者ID:queile,项目名称:peca-android-upnp,代码行数:22,代码来源:Simple_vp.cpp

示例15: CreateTrayIcon

static void CreateTrayIcon(bool create)
{
	NOTIFYICONDATA nim;
	DBVARIANT dbVar;
	if (!db_get_ts(NULL,MOD_NAME,"ToolTipText",&dbVar))
	{
		mir_sntprintf(nim.szTip, 64, _T("%s"), dbVar.ptszVal);
		db_free(&dbVar);
	}
	else
		lstrcpy(nim.szTip, _T("Miranda NG"));

	nim.cbSize = sizeof(nim);
	nim.hWnd = g_hListenWindow;
	nim.uID = 100;
	nim.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
	nim.hIcon = Skin_GetIcon("hidemim");
	nim.uCallbackMessage = WM_USER + 24;
	Shell_NotifyIcon(create ? NIM_ADD : NIM_DELETE, &nim);
	g_TrayIcon = create;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:21,代码来源:BossKey.cpp


注:本文中的Shell_NotifyIcon函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。