Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
424 views
in Technique[技术] by (71.8m points)

registry - read/write registery key file in uwp

I want to create or read a registery file within a uwp app. Then I should be able to add menu item to windows context menu. I'm aware that this is not possible, because uwp apps run in a sandbox. I'cant find any source about that topic for uwp.

Can someone approve that my plan is realisable for a uwp app?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I want to create or read a registry file within a uwp app.

Short answer is accessing to system registry is infeasible for a UWP app.

Under the UWP app model, each UWP app is isolated by running inside separate AppContainer. The runtime also isolates registry access.

You can find more information on UPW app model form the Build 2015 Keynote, slides can be found along with the video. https://channel9.msdn.com/Events/Build/2015/2-617

There’s also a deeper dive into the app model from https://blogs.windows.com/buildingapps/2015/04/30/a-deeper-dive-into-the-universal-windows-platform/

However, you can try out the Brokered Windows Runtime Components for side-loaded Windows Store apps. Essentially, it allows you UWP app to call Win32 API hosted in a different process, which runs outside of the App container.

Below is the brokered WinRT component template for VS2015 https://visualstudiogallery.msdn.microsoft.com/d2e9cac0-66a8-464a-a902-55ae765c8e6e?tduid=(c5f2776eb12ea55b8926d0c075062c9d)(256380)(2459594)(TnL5HPStwNw-gN1OuW5VyKxMyOTAH.bK0w)()

Below is a very good example for creating brokered components for UWP, https://xamltips.wordpress.com/2015/11/13/brokered-component-for-uwp-on-windows-10/

For more information, see to https://msdn.microsoft.com/en-us/library/windows/apps/dn630195.aspx


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...