windows-8

SetSuspendState() API never returns in Win8

梦想的初衷 提交于 2019-12-11 19:20:32
问题 Let me explain my problem statement: In my VC++ project I want to insert a logic to send my system (Windows 8) to Sleep state programatically & resume back. I'm doing it like this (Copying the code snippet) :: int wait = 100; LARGE_INTEGER WaitTime; WaitTime.QuadPart = wait; WaitTime.QuadPart *= -10000000; HANDLE hTimer = CreateWaitableTimer(NULL, FALSE, NULL); if(0 == SetWaitableTimer(hTimer, &WaitTime, 0, NULL, NULL, TRUE)) { res = false; return res; } if(0 == SetSuspendState(FALSE, FALSE,

Select query of sqlite in metro app?

风格不统一 提交于 2019-12-11 19:05:48
问题 I have seen quite a number of examples describing the usage of SQLite in Metro app. Most of the examples have either Orderby/Insert/Delete statements. May I know how do I get the data from a pre-populated db using the Select statement? Secondly, how does someone store the data into an array or arrayList after the execution of the query? Kindly help me with this, Thanks. 回答1: See if this example is what you're looking for: return db.runAsync('SELECT * FROM Table'); Here is a pretty useful

How can i change background image of a button when hover or click in XAML for Windows 8?

五迷三道 提交于 2019-12-11 19:04:46
问题 I got a question about changing the background image of a button when it's clicked. I tried searching on google but i couldn't find something that worked for me. Well here's my code <Button Grid.Column="0" Grid.Row="0" x:Name="btnHome" VerticalAlignment="Stretch" BorderBrush="{x:Null}" HorizontalAlignment="Stretch" Click="btnHome_Click" PointerEntered="btnHome_PointerEntered"> <Button.Template> <ControlTemplate TargetType="Button"> <Border x:Name="RootElement"> <VisualStateManager

How to set text including new line character in storyboard

喜你入骨 提交于 2019-12-11 18:47:59
问题 Want to replace "\n" with new line character <VisualState x:Name="Snapped"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Text" Storyboard.TargetName="textBlock"> <DiscreteObjectKeyFrame KeyTime="0" Value="Here is my text.\nThis is new line"/> </Storyboard> </VisualState> The output text is: Here is my text.\nThis is new line without new line character. P.S.: If this value can be filled with the string in resource file that would be a great..!! Either way will help me

How can I save an image from an ImageSource without downloading again?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 18:46:21
问题 this is an extension to my previous question how should a metro app cache images for tombstoning (and should it)? The solutions that I have been finding are to use HttpClient, but this results in an unnecessary second hit per file on the web server. Is there anyway to save the existing image/stream from a Image/ImageSource (using the ImageOpened event to ensure it is available) ? Solution must work with current RP API as this is an area where large changes have been made from CP. 回答1: First

Create Simple Custom XAML / C# button

浪子不回头ぞ 提交于 2019-12-11 18:43:58
问题 First of all, I'm new to XAML / C# (am iOS/Android programmer) so please bear with me instead of immediately voting down. My app has some GridViews that contain buttons. A lot of these buttons are similar and I would like to refactor this. For simplicity let's say my buttons are just Rectangles with a given color. This color might come from the Item class that defines the particular item in the GridView, or it might be hardcoded. I want the rectangle to change color on hover and pressed

Location tracking windows 8

青春壹個敷衍的年華 提交于 2019-12-11 18:39:54
问题 Im working on a reminder which also supports location-based reminders (eg when you get near your house it tells you to switch off the alarm for example).. I need the app to check the location lets say every 2 minutes (so it doesnt drain the battery too much). What technology should I use? I was thinking about toast notifications but this is to remind the user the he is approaching the location, but there needs to be a background task which checks the location even if the app is not running?

Does anyone know of a QR Code Reader library for a Windows 8 Metro App?

我怕爱的太早我们不能终老 提交于 2019-12-11 18:08:00
问题 We're looking to read some QR codes in a Windows 8 Metro app. .NET libraries we've used in the past can't be referenced in WinRT/Metro and porting them won't be easy because they depend on System.Drawing which isn't in the .NET for Metro style apps. We looked at this by Benjamin Soulier but it didn't seem to work. Any other suggestions or something easy we're missing? Thanks 回答1: You can use ZXing.Net: http://zxingnet.codeplex.com/ For Metro apps based upon HTML5/Javascript I'm currently

Is it possible to hide the SIP (soft keyboard) in Win 8?

女生的网名这么多〃 提交于 2019-12-11 17:51:24
问题 When the user edits a record, a XAML Popup shows a small form. The software keyboard appears when the user gives focus to a TextBox. This is good. OnKeyDown (if Enter ) I commit the user's changes. After the changes are committed, I hide the XAML Popup. The SIP remains visible even though the form is invisible. What is the correct way to handle this scenario? PS: this ( Show/Hide Keyboard programmatically on windows8 ) is not a solution to this problem. That's because the question is wanting