📄 settingsapi.hpp
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#pragma once
#ifndef __SETTINGSAPI_HPP__
#define __SETTINGSAPI_HPP__
#include <windows.h>
const DWORD c_MaxUIVolume = 10;
const DWORD c_MinUIVolume = 0;
/*------------------------------------------------------------------------------
PhSetting
Settings for the phone application
------------------------------------------------------------------------------*/
enum PHSetting
{
phsDoNotDisturb = 0,
phsCallForwarding,
phsAutoDial,
phsBlockCallerId,
phsMissedCalls,
phsIncomingCalls,
phsOutgoingCalls,
phsGalFilterType,
phsContactFilterType,
phsDeviceLocked,
phsAutoDialRulesAvailability,
phsPhoneAppStatus,
phsDisableAGC,
phsLockPhoneAfterUpdatingPIN,
};
/*------------------------------------------------------------------------------
PhGetSetting
Gets the current value for a setting
------------------------------------------------------------------------------*/
EXTERN_C
DWORD
WINAPI
PHGetSetting(
PHSetting Setting
);
/*------------------------------------------------------------------------------
PHSetValue
Sets the new value for a setting
------------------------------------------------------------------------------*/
EXTERN_C
HRESULT
WINAPI
PHSetValue(
PHSetting Setting,
DWORD Value
);
/*------------------------------------------------------------------------------
PhVolumeSetting
Volume settings for the phone application
------------------------------------------------------------------------------*/
enum PHVolumeSetting
{
phvsSpeakerVolume,
phvsRingerVolume,
phvsHandsetVolume,
phvsMicrophoneVolume,
};
/*------------------------------------------------------------------------------
PHGetVolumeSetting
Gets the current value for a volume setting
------------------------------------------------------------------------------*/
EXTERN_C
DWORD
WINAPI
PHGetVolumeSetting(
PHVolumeSetting Setting
);
/*------------------------------------------------------------------------------
PHSetVolume
Sets the new value for a volume setting
------------------------------------------------------------------------------*/
EXTERN_C
HRESULT
WINAPI
PHSetVolume(
PHVolumeSetting Setting,
DWORD Value
);
/*------------------------------------------------------------------------------
PHActiveVolumeMode
Volume modes for the phone application
------------------------------------------------------------------------------*/
enum PHActiveVolumeMode
{
SpeakerVolumeMode = 0,
RingerVolumeMode,
LastVolumeMode, //MUST be the last item
};
/*------------------------------------------------------------------------------
PHSetActiveVolume
Sets the active volume mode
------------------------------------------------------------------------------*/
EXTERN_C
HRESULT
WINAPI
PHSetActiveVolume (
PHActiveVolumeMode VolumeMode
);
/*------------------------------------------------------------------------------
PHGetActiveVolume
Get the active volume mode
------------------------------------------------------------------------------*/
EXTERN_C
PHActiveVolumeMode
WINAPI
PHGetActiveVolume (
void
);
/*------------------------------------------------------------------------------
PHWritePIN/PHReadPIN
Read/Write PIN APIs (the PIN is encrypted...)
------------------------------------------------------------------------------*/
EXTERN_C
HRESULT
WINAPI
PHWritePIN(
__in const WCHAR* pPinString
);
EXTERN_C
HRESULT
WINAPI
PHReadPIN(
__out_ecount(BufferLength) WCHAR* pPinBuffer,
int BufferLength
);
enum AuthenticationResult_e
{
AuthCanceled = 0,
AuthInProgress,
AuthSucceeded,
};
typedef struct tagPH_AUTHENTICATE_USER_PARAMETERS
{
UINT StructSize; //IN - size of struct
HWND NotificationWindow; //IN - window to receive notification when authentication is done
UINT NotificationMessage; //IN - message to be sent to the window when authentication is done
// WPARAM: AuthenticationResult_e indicating the status of the user authentication
// LPARAM: Not used
AuthenticationResult_e Result; //OUT - result of the authentication try -
// Possible values = AuthSucceeded: user is authenticated
// = AuthInProgress: user is being challenged
} PH_AUTHENTICATE_USER_PARAMETERS;
/*------------------------------------------------------------------------------
PHAuthenticateUser
Check if the user is authenticated or not. If not, show the
challenge UI and report back to the caller. The caller can cancel an existing request
with PHCancelAuthenticationRequest
------------------------------------------------------------------------------*/
EXTERN_C
HRESULT
PHAuthenticateUser(
__inout PH_AUTHENTICATE_USER_PARAMETERS* pParams
);
/*------------------------------------------------------------------------------
PHCancelAuthenticationRequest
Cancel the current authentication request for
the specified window
Parameters:
: HWND - the window the authentication request belongs to
Returns (HRESULT): indicating success or failure
------------------------------------------------------------------------------*/
EXTERN_C
HRESULT
PHCancelAuthenticationRequest(
HWND hwnd
);
#endif // !defined __SETTINGSAPI_HPP__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -