ReactOS 0.4.15-dev-7906-g1b85a5f
addressband.cpp File Reference
#include "precomp.h"
#include <commoncontrols.h>
#include <shlwapi_undoc.h>
#include <shellapi.h>
Include dependency graph for addressband.cpp:

Go to the source code of this file.

Functions

static WCHAR GetAccessKeyFromText (WCHAR chAccess, LPCWSTR pszText)
 
static WCHAR GetAddressBarAccessKey (WCHAR chAccess)
 

Function Documentation

◆ GetAccessKeyFromText()

static WCHAR GetAccessKeyFromText ( WCHAR  chAccess,
LPCWSTR  pszText 
)
static

Definition at line 262 of file addressband.cpp.

263{
264 for (const WCHAR *pch = pszText; *pch != UNICODE_NULL; ++pch)
265 {
266 if (*pch == L'&' && pch[1] == L'&')
267 {
268 /* Skip the first '&', the second is skipped by the for-loop */
269 ++pch;
270 continue;
271 }
272 if (*pch == L'&')
273 {
274 ++pch;
275 chAccess = *pch;
276 break;
277 }
278 }
279
280 ::CharUpperBuffW(&chAccess, 1);
281 return chAccess;
282}
#define pch(ap)
Definition: match.c:418
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
DWORD WINAPI CharUpperBuffW(_Inout_updates_(cchLength) LPWSTR lpsz, _In_ DWORD cchLength)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by GetAddressBarAccessKey().

◆ GetAddressBarAccessKey()

static WCHAR GetAddressBarAccessKey ( WCHAR  chAccess)
static

Definition at line 284 of file addressband.cpp.

285{
286 static WCHAR s_chCache = 0;
287 static LANGID s_ThreadLocale = 0;
288 if (s_chCache && s_ThreadLocale == ::GetThreadLocale())
289 return s_chCache;
290
291 WCHAR szText[80];
292 if (!LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_ADDRESSBANDLABEL,
293 szText, _countof(szText)))
294 {
295 return chAccess;
296 }
297
298 s_chCache = GetAccessKeyFromText(chAccess, szText);
299 s_ThreadLocale = ::GetThreadLocale();
300 return s_chCache;
301}
static WCHAR GetAccessKeyFromText(WCHAR chAccess, LPCWSTR pszText)
#define IDS_ADDRESSBANDLABEL
Definition: resource.h:126
LCID WINAPI GetThreadLocale(void)
Definition: lang.c:1459
USHORT LANGID
Definition: mui.h:9
#define _countof(array)
Definition: sndvol32.h:68
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

Referenced by CAddressBand::TranslateAcceleratorIO().