Esempio n. 1
0
void CPlugin::OnDeactivate( void )
{
  OutputDebugString("CPlugin::OnDeactivate() called\n");

  sys_Printf(BIC_INFO,"%s Plugin by %s Deactivated\n", m_Name, m_Author);

  // do de-activation code here

  int i;

  /*
  if (g_hToolbarImageList)
  {
    int i = g_LastImage;
    int count = 0;
    while (i >= g_FirstImage)
    {
      count++;
      g_ToolbarImageList.Remove(i--);
    }

    g_ToolbarImageList.Detach();
  }
  */

  if (g_hToolBarWnd)
  {
    g_ToolbarImageList.Destroy();
    // remove the buttons (remembering that other buttons may have been added
    // or removed since we started, so we can't do it by remember the indexes when
    // we add the buttons...
    if (g_ButtonsAdded)
    {
      for (i = 0 ; i < TOOLBAR_BUTTON_COUNT; i ++)
        g_Toolbar.DeleteButton(g_Toolbar.CommandToIndex(ToolbarIDs[i]));
    }

    g_Rebar.Detach();
  }

  for (i = 0 ; i < TOOLBAR_BUTTON_COUNT; i ++)
    HydraIRC_ReleaseToolbarID(ToolbarIDs[i]);

  HydraIRC_ReleaseImageListID(g_ImageListID);

}
Esempio n. 2
0
void
CNdasDeviceMenu::CreateDeviceMenuItem(
	__in ndas::DevicePtr pDevice,
	__inout MENUITEMINFO& mii)
{
	static BOOL requireVistaMenuBitmapBugWorkaround = 
		RequireVistaMenuBitmapBugWorkaround();

	mii.fMask = 
		MIIM_BITMAP | MIIM_DATA | MIIM_FTYPE | /* MIIM_ID | */ 
		MIIM_STATE | MIIM_STRING | MIIM_SUBMENU;

	mii.fType = MFT_STRING;
	mii.fState = MFS_ENABLED;
	mii.dwItemData; /* see next */
	mii.dwTypeData = const_cast<LPTSTR>(pDevice->GetName());

	//
	// As we don't want to invert the color of the status indicator
	// we cannot simply create a bitmap here. We should draw it from the callback.
	//
	// Vista 5384 does not accept HBMMENU_CALLBACK
	// (Seems like a bug)
	//
	if (requireVistaMenuBitmapBugWorkaround)
	{
		CImageList imageList = pLoadStatusIndicatorImageList();
		NDSI_DATA ndsiData;
		ATLVERIFY( mii.hSubMenu = CreateDeviceSubMenu(pDevice, &ndsiData) );
		mii.hbmpItem = pCreateStatusIndicatorBitmap(m_wnd, imageList, &ndsiData);
		ATLVERIFY( imageList.Destroy() );
	}
	else
	{
		mii.hbmpItem = HBMMENU_CALLBACK;
		ATLVERIFY(mii.hSubMenu = 
			CreateDeviceSubMenu(
			pDevice, 
			reinterpret_cast<PNDSI_DATA>(&mii.dwItemData)));
	}
}