Button(){Text('开启隐藏');}.width(80).height(60).onClick(()=>{let isPrivacyMode: boolean =true;try{
window.getLastWindow(getContext(),(err: BusinessError, data)=>{const errCode = err.code;if(errCode){return;}let promise = data.setWindowPrivacyMode(isPrivacyMode);
promise.then(()=>{this.message ='隐私模式';
hilog.info(0x0000,'testTag','已成功将窗口设置为隐私模式.');}).catch((err: BusinessError)=>{
hilog.error(0x0000,'testTag','Failed to set the window to privacy mode. Cause: '+JSON.stringify(err));});});}catch(exception){
hilog.error(0x0000,'testTag','Failed to set the window to privacy mode. Cause:'+JSON.stringify(exception));}});