ReactOS 0.4.16-dev-822-gbcedb53
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)
 

Variables

static const GUID THISMODULE_GUID = { 0x60ebab6e, 0x2e4b, 0x42f6, { 0x8a,0xbc,0x80,0x73,0x1c,0xa6,0x42,0x02} }
 

Function Documentation

◆ GetAccessKeyFromText()

static WCHAR GetAccessKeyFromText ( WCHAR  chAccess,
LPCWSTR  pszText 
)
static

Definition at line 279 of file addressband.cpp.

280{
281 for (const WCHAR *pch = pszText; *pch != UNICODE_NULL; ++pch)
282 {
283 if (*pch == L'&' && pch[1] == L'&')
284 {
285 /* Skip the first '&', the second is skipped by the for-loop */
286 ++pch;
287 continue;
288 }
289 if (*pch == L'&')
290 {
291 ++pch;
292 chAccess = *pch;
293 break;
294 }
295 }
296
297 ::CharUpperBuffW(&chAccess, 1);
298 return chAccess;
299}
#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 301 of file addressband.cpp.

302{
303 static WCHAR s_chCache = 0;
304 static LANGID s_ThreadLocale = 0;
305 if (s_chCache && s_ThreadLocale == ::GetThreadLocale())
306 return s_chCache;
307
308 WCHAR szText[80];
309 if (!LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_ADDRESSBANDLABEL,
310 szText, _countof(szText)))
311 {
312 return chAccess;
313 }
314
315 s_chCache = GetAccessKeyFromText(chAccess, szText);
316 s_ThreadLocale = ::GetThreadLocale();
317 return s_chCache;
318}
static WCHAR GetAccessKeyFromText(WCHAR chAccess, LPCWSTR pszText)
#define IDS_ADDRESSBANDLABEL
Definition: resource.h:126
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2801
USHORT LANGID
Definition: mui.h:9
#define _countof(array)
Definition: sndvol32.h:70
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().

Variable Documentation

◆ THISMODULE_GUID

const GUID THISMODULE_GUID = { 0x60ebab6e, 0x2e4b, 0x42f6, { 0x8a,0xbc,0x80,0x73,0x1c,0xa6,0x42,0x02} }
static

Definition at line 41 of file addressband.cpp.

Referenced by CAddressBand::IsGoButtonVisible(), and CAddressBand::QueryService().