windows-store-apps

Get free disk space in WinRT using C#

放肆的年华 提交于 2019-12-10 19:06:19
问题 [DllImport("kernel32.dll", SetLastError = true)] static extern bool GetDiskFreeSpaceEx( string lpDirectoryName, out ulong lpFreeBytesAvaliable, out ulong lpTotalNumberOfBytes, out ulong lpTotalNumberOfFreeBytes); // Returns free disk space from directory. public static ulong GetFreeDiskSpace(string directory) { ulong a, b, c; if (GetDiskFreeSpaceEx(directory, out a, out b, out c)) { Debug.WriteLine(a); } return a; } I'm developing a Windows Store App. Why a variable contains 0 when I call:

How to make Window.Current visible after it was closed?

吃可爱长大的小学妹 提交于 2019-12-10 19:01:51
问题 I have an application that opens new windows. If the original window is closed and then the user starts the app (e.g. from the start menu) - TryShowAsStandaloneAsync fails in opening a new window (Why?). So I want to "revive" the original one. But though I use Window.Current.Activate(); and frame.Navigate(...); - Window.Current.Visible is always false (and the window is not shown again). So how can I "revive" a closed window? (Or use TryShowAsStandaloneAsync from a closed window.) 回答1: I

“The buffer allocated is insufficient” exception while calling BitmapEncoder.SetPixelData

隐身守侯 提交于 2019-12-10 19:00:15
问题 I want to create a white image run time in my Windows 8 app. I thought I will create a byte array and then will write onto file. But I am getting exception The buffer allocated is insufficient. (Exception from HRESULT: 0x88982F8C) . What's wrong with my code? double dpi = 96; int width = 128; int height = 128; byte[] pixelData = new byte[width * height]; for (int y = 0; y < height; ++y) { int yIndex = y * width; for (int x = 0; x < width; ++x) { pixelData[x + yIndex] = (byte)(255); } } var

How to build Windows 10 appxupload(ready to submit to store) package by command line

柔情痞子 提交于 2019-12-10 18:38:23
问题 Tried with msbuild command line as msbuild App1.sln /t:Publish /p:Configuration=Release and also tried as described in http://blogs.msdn.com/b/wsdevsol/archive/2014/02/12/create-a-windows-store-appx-package-and-sign-it.aspx, only appx packages are built which cannot be used to submit to store. 回答1: Try to add the /p:AppxPackageIsForStore=true parameter. 回答2: We're using option: /p:UapAppxPackageBuildMode=StoreUpload There's a good related blog post here: https://blogs.msdn.microsoft.com

How to insert complex models in a sqlite table?

我与影子孤独终老i 提交于 2019-12-10 18:36:24
问题 First of all I should apologize if the question doesn't seem a pro one however I have no idea how to deal with it. I actually have a Person class in which there are another class namely Address and the Address class itself have properties whose types are another class namely Province and City. public class Province { public string Name { get; set; } } public class City { public string Name { get; set; } } public class Address { public Province Province { get; set; } public City City { get;

Working with MIDI in Windows Store App (Win 8.1)

人走茶凉 提交于 2019-12-10 18:22:33
问题 My goal is to receive MIDI messages in Windows Store Apps. Microsoft has delivered an API called Microsoft.WindowsPreview.MidiRT (as a nuget package). I managed to get a midi port, but MessageReceived event is not arised, although I'm pressing keys on my MIDI keyboard, and other MIDI programs show me that PC receives these messages. Here is my code: public sealed partial class MainPage : Page { private MidiInPort port; public MainPage() { this.InitializeComponent(); DeviceWatcher watcher =

how to disable caching HTTP GET in metro app, I am using IXMLHTTPRequest2

六眼飞鱼酱① 提交于 2019-12-10 18:10:18
问题 I am doing an http GET to fetch data, I am using IXMLHTTPRequest2. If I GET url "http://foo.com" (curl "http://foo.com"), the second time I get this url again, the content on server is actually changed, but what I am getting is the cached result. Caching seems only honor URL, so if different header with same URL, still same cached result. I have tried "Cache-Control: no-cache", "Cache Control: no-store", and "Pragma: no-cache". None of them are honored by the API. Is there a way to turn cache

Debugging Windows 8 App using windbg

强颜欢笑 提交于 2019-12-10 17:37:45
问题 I have a Windows 8 Application Store app that needs to be debugged on one of our lab machines. The machines in the lab have windbg but do not have Visual Studio. When I launch the EXE using windbg, I get a message that says "This application can be ran only in the context of an app container". Is there anyway to get Windbg.exe to create the app container context? 回答1: WinDbg can attach pretty much to any running process. You can start your app in a regular way from the start screen and try to

WP8 - This package is using an app name that hasn't been reserved for this app

别等时光非礼了梦想. 提交于 2019-12-10 17:18:45
问题 I am submitting Windows Phone 8 app to app store, when I click on Review And Submit I get the Error : This package is using an app name that hasn't been reserved for this app In my WPAppManifest.xml file : Display Name is : GS Value // just an example Here GS has full form as Global Service, if I use this name in app list screen the text cuts so I have made it as GS Value. And when I am submitting the app I have reserved the name as Global Service : Value . So my Display name in WPAppManifest

Can msbuild create an .appxbundle for multiple platforms?

夙愿已清 提交于 2019-12-10 16:48:34
问题 I'm trying to build an .appxbundle for my Windows 10 UWP Store app using msbuild that contains x86, x64, and ARM platforms. I can do this from VS2015 RTM using the Create App Pacakges wizard, but I get errors when I use msbuild. Any idea what I'm doing wrong? My command line: msbuild HelloWorld.csproj /p:Configuration=Release;AppxBundle=Always Errors I'm getting: "E:\TestApps\HelloWorld.csproj" (default target) (1) -> (_CreateBundle target) -> C:\Program Files (x86)\MSBuild\Microsoft