Esempio n. 1
0
		IFACEMETHODIMP Credential::GetBitmapValue(__in DWORD dwFieldID, __out HBITMAP* phbmp)
		{
			if(!m_fields || dwFieldID >= m_fields->fieldCount || !phbmp)
				return E_INVALIDARG;

			if(m_fields->fields[dwFieldID].fieldDescriptor.cpft != CPFT_TILE_IMAGE)
				return E_INVALIDARG;

			HBITMAP bitmap = NULL;
			std::wstring tileImage = pGina::Registry::GetString(L"TileImage", L"");
			if(tileImage.empty() || tileImage.length() == 1)
			{
				// Use builtin
				bitmap = LoadBitmap(GetMyInstance(), MAKEINTRESOURCE(IDB_LOGO_MONOCHROME_200));
			}
			else
			{
				pDEBUG(L"Credential::GetBitmapValue: Loading image from: %s", tileImage.c_str());
				bitmap = (HBITMAP) LoadImageW((HINSTANCE) NULL, tileImage.c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);			
			}
			
			if(!bitmap)
				return HRESULT_FROM_WIN32(GetLastError());
			
			*phbmp = bitmap;
			return S_OK;
		}
Esempio n. 2
0
void GetLocalisationApiService(void)
{
	if (!WASABI_API_LNG)
	{
		// loader so that we can get the localisation service api for use
		if (!WASABI_API_SVC)
		{
			WASABI_API_SVC = (api_service*)SendMessage(winampwnd, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
			if (WASABI_API_SVC == (api_service*)1)
			{
				WASABI_API_SVC = NULL;
				return;
			}
		}

		if (!WASABI_API_LNG)
		{
			waServiceFactory *sf;
			sf = WASABI_API_SVC->service_getServiceByGuid(languageApiGUID);
			if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());
		}

		// need to have this initialised before we try to do anything with localisation features
		WASABI_API_START_LANG(GetMyInstance(), EncFlakeLangGUID);
	}
}
Esempio n. 3
0
	__declspec( dllexport ) winampVisHeader *winampVisGetHeader(HWND hwndParent)
	{
		if(!WASABI_API_LNG_HINST)
		{
			// loader so that we can get the localisation service api for use
			WASABI_API_SVC = (api_service*)SendMessage(hwndParent, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
			if (WASABI_API_SVC == (api_service*)1) WASABI_API_SVC = NULL;

			waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(languageApiGUID);
			if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());

			sf = WASABI_API_SVC->service_getServiceByGuid(applicationApiServiceGuid);
			if (sf) WASABI_API_APP = reinterpret_cast<api_application*>(sf->getInterface());

			sf = WASABI_API_SVC->service_getServiceByGuid(syscbApiServiceGuid);
			if (sf) WASABI_API_SYSCB = reinterpret_cast<api_syscb*>(sf->getInterface());

			// need to have this initialised before we try to do anything with localisation features
			WASABI_API_START_LANG(GetMyInstance(),VisMilkdropLangGUID);

			/* added for v2.25 as a quick work around to allow partial
			/* keyboard mappings (mainly coming from de-de requirements)
			** [yY][Y][yY][zZ]
			**  1   2   3   4
			**
			** 1 - does yes for the 3 different prompt types
			** 2 - does Ctrl+Y for stopping display of custom message of song title
			** 3 - something for preset editing (not 100% sure what)
			** 4 - used for the previous track sent to Winamp
			*/
			WASABI_API_LNGSTRING_BUF(IDS_KEY_MAPPINGS, keyMappings, 8);

			// as we're under a different thread we need to set the locale
			//WASABI_API_LNG->UseUserNumericLocale();
			g_use_C_locale = WASABI_API_LNG->Get_C_NumericLocale();
		}

		return &hdr;
	}
Esempio n. 4
0
		void DialogLoggedOutSAS::ApplyLogoImage()
		{
			if(m_bitmap == NULL)
			{
				std::wstring tileImage = pGina::Registry::GetString(L"TileImage", L"");
				if(tileImage.empty() || tileImage.length() == 1)
				{
					// Use builtin
					m_bitmap = LoadBitmap(GetMyInstance(), MAKEINTRESOURCE(IDB_PGINA_LOGO));
				}
				else
				{
					pDEBUG(L"Credential::GetBitmapValue: Loading image from: %s", tileImage.c_str());
					m_bitmap = (HBITMAP) LoadImageW((HINSTANCE) NULL, tileImage.c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);			
				}				
			}

			if(m_bitmap)
			{
				SetItemBitmap(IDC_LOGO, m_bitmap);
			}
		}
StatusWindow::StatusWindow(HDESK hdesk, const wchar_t* title, const wchar_t* message)
  : _hdesk(hdesk), _hwnd(0)
{

    EnterDesktop enterDesktop(_hdesk);

    _hwnd = CreateDialog(GetMyInstance(), MAKEINTRESOURCE(IDD_STATUS), 0, _dialogProc);
    GuiHelper::CenterWindow(_hwnd);
    ShowWindow(_hwnd, SW_SHOW);

    if (_hwnd)
	{
        if (GuiHelper::SetControlText(_hwnd, IDC_MESSAGE, message))
		{
            if (title)
			{
                SetWindowText(_hwnd, title);
            }
        }
    }
    else LCF1(L"CreateDialogParam failed: %d", GetLastError());
}
Esempio n. 6
0
		DialogBase::DialogBase(WinlogonInterface * iface, int dialogId) :
			m_winlogon(iface), m_dialogId(dialogId), m_instance(GetMyInstance()), m_hwnd(0), m_nextTimer(1)
		{
		}