Add a BMP image for PLAP tile and use it

pull/529/head
Lev Stipakov 2022-10-12 12:24:00 +03:00 committed by Selva Nair
parent a500b9553e
commit 70610afc2f
4 changed files with 27 additions and 1 deletions

View File

@ -26,6 +26,7 @@
#include <winresrc.h>
#include <richedit.h>
#include "../openvpn-gui-res.h"
#include "resource.h"
/* Language resource files are UTF-8 encoded */
#pragma code_page(65001)
@ -39,6 +40,8 @@ ID_ICO_CONNECTED ICON DISCARDABLE "../res/connected.ico"
ID_ICO_CONNECTING ICON DISCARDABLE "../res/connecting.ico"
ID_ICO_DISCONNECTED ICON DISCARDABLE "../res/disconnected.ico"
IDB_TILE_IMAGE BITMAP DISCARDABLE "../res/tileimage.bmp"
#ifdef ENABLE_OVPN3
#define ADVANCED_DIALOG_HEIGHT 320
#else

View File

@ -27,6 +27,7 @@
#include "plap_connection.h"
#include "plap_dll.h"
#include <assert.h>
#include "resource.h"
/* A "class" that implements IConnectableCredentialProviderCredential */
@ -343,9 +344,30 @@ GetStringValue(ICCPC *this, DWORD index, WCHAR **ws)
static HRESULT WINAPI
GetBitmapValue(UNUSED ICCPC *this, DWORD field, HBITMAP *bmp)
{
HRESULT hr = S_OK;
dmsg(L"field = %lu ", field);
return E_NOTIMPL;
if (field_desc[field].cpft == CPFT_TILE_IMAGE && bmp)
{
HBITMAP tmp = LoadBitmapW(hinst_global, MAKEINTRESOURCE(IDB_TILE_IMAGE));
if (tmp)
{
*bmp = tmp; /* The caller takes ownership of this memory */
dmsg(L"Returning a bitmap for PLAP tile %lu", field);
}
else
{
hr = HRESULT_FROM_WIN32(GetLastError());
dmsg(L"LoadBitmap failed with error = 0x%08x", hr);
}
}
else
{
hr = E_INVALIDARG;
}
return hr;
}
/*

1
plap/resource.h Normal file
View File

@ -0,0 +1 @@
#define IDB_TILE_IMAGE 101

BIN
res/tileimage.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB