コード例 #1
0
ファイル: FDMForFirefox.cpp プロジェクト: naroya/fdm
NS_IMETHODIMP CFDMForFirefox::IsALTShouldBePressed(PRBool *_retval)
{
	if (is_FlashGotInstalled ())
	{
		*_retval = FALSE;
		return NS_OK;
	}

   	DWORD dw1 = TRUE, dw2 = FALSE;
	
	m_keyFDMMonitor.QueryValue (dw1, "Firefox");

	if (dw1)
		m_keyFDMMonitor.QueryValue (dw2, "ALTShouldPressed");

	*_retval = dw1 && dw2;

	return NS_OK;
}
コード例 #2
0
ファイル: FDMForFirefox.cpp プロジェクト: naroya/fdm
NS_IMETHODIMP CFDMForFirefox::IsLinkShouldBeSkipped(IFDMUrl *url, const PRUnichar *wstrSuggFileName, PRBool *_retval)
{
	*_retval = TRUE;

	if (is_FlashGotInstalled ())
		return NS_OK;

	DWORD dw = TRUE;

	m_keyFDMMonitor.QueryValue (dw, "Firefox");
	if (dw == FALSE)
		return NS_OK;

	dw = FALSE;
	m_keyFDMMonitor.QueryValue (dw, "ALTShouldPressed");
	if (dw)
		return NS_OK;

	*_retval = IsUrlShouldBeSkipped (url, wstrSuggFileName);

    return NS_OK;
}  
コード例 #3
0
ファイル: FDMForFirefox.cpp プロジェクト: naroya/fdm
NS_IMETHODIMP CFDMForFirefox::IsContextMenuItemShouldBeHidden(const char *strMenuItemID, PRBool *_retval)
{
	if (is_FlashGotInstalled ())
	{
		*_retval = TRUE;
		return NS_OK;
	}

	CRegKey key;

	

	key.Open (m_keyFDM, "Settings\\Monitor\\IEMenu", KEY_READ);

	DWORD dwShow = TRUE;

	key.QueryValue (dwShow, "Enable");
	
	if (dwShow)
	{
		if (lstrcmp (strMenuItemID, "dllink") == 0)
			key.QueryValue (dwShow, "DLThis");

		else if (lstrcmp (strMenuItemID, "dlall") == 0)
			key.QueryValue (dwShow, "DLAll");

		else if (lstrcmp (strMenuItemID, "dlselected") == 0)
			key.QueryValue (dwShow, "DLSelected");

		else if (lstrcmp (strMenuItemID, "dlvideo") == 0)
			key.QueryValue (dwShow, "DLFlashVideo");
	}

	*_retval = !dwShow;

    return NS_OK;
}
コード例 #4
0
NS_IMETHODIMP CFDMForFirefox::IsContextMenuItemShouldBeHidden(const char *strMenuItemID, PRBool *_retval)
{
	if (is_FlashGotInstalled ())
	{
		*_retval = TRUE;
		return NS_OK;
	}

	CRegKey key;

	

	key.Open (m_keyFDM, "Settings\\Monitor\\IEMenu", KEY_READ);

	DWORD dwShow = TRUE;

	HANDLE hmx = CreateMutex (NULL, FALSE, "mx::fdm: brmenu_disable");
	if (GetLastError () == ERROR_ALREADY_EXISTS)
		dwShow = FALSE;
	else
		key.QueryValue (dwShow, "Enable");
	CloseHandle (hmx);
	
	if (dwShow)
	{
		fsString strMxName, strValName;

		if (lstrcmp (strMenuItemID, "dllink") == 0)
		{
			strValName = "DLThis";
			strMxName = "mx::fdm: dllink_disable";
		}

		else if (lstrcmp (strMenuItemID, "dlall") == 0)
		{
			strValName = "DLAll";
			strMxName = "mx::fdm: dlall_disable";
		}

		else if (lstrcmp (strMenuItemID, "dlselected") == 0)
		{
			strValName = "DLSelected";
			strMxName = "mx::fdm: dlselected_disable";
		}

		else if (lstrcmp (strMenuItemID, "dlvideo") == 0)
		{
			strValName = "DLFlashVideo";
			strMxName = "mx::fdm: dlvideo_disable";
		}

		HANDLE hmx = CreateMutex (NULL, FALSE, strMxName);
		if (GetLastError () == ERROR_ALREADY_EXISTS)
			dwShow = FALSE;
		else
			key.QueryValue (dwShow, strValName);
		CloseHandle (hmx);
	}

	*_retval = !dwShow;

    return NS_OK;
}