WPF WebBrowser Control – position:fixed Element jumps while scrolling (Windows 8)

If there are discrepancies in behavior of the same web page loaded into WebBrowser control and standalone IE browser, the problem can often be fixed by implementing WebBrowser Feature Control. Once the feature control has been implemented, it makes sense to verify that <!DOCTYPE html> is observed by WebBrowser and the page is actually rendered … Read more

Windows Phone 8 emulator can’t connect to the internet

I think I’ve finally found the answer, but you’re probably not going to like it. It would appear that the phone emulator requires you to have a second network adapter to dedicate to this purpose. Personally, I run Windows 8 in VMWare, and so a second network adapter is free for me. Anyway, after you … Read more

How do I create a shortcut via command-line in Windows?

You could use a PowerShell command. Stick this in your batch script and it’ll create a shortcut to %~f0 in %userprofile%\Start Menu\Programs\Startup: powershell “$s=(New-Object -COM WScript.Shell).CreateShortcut(‘%userprofile%\Start Menu\Programs\Startup\%~n0.lnk’);$s.TargetPath=”%~f0″;$s.Save()” If you prefer not to use PowerShell, you could use mklink to make a symbolic link. Syntax: mklink saveShortcutAs targetOfShortcut See mklink /? in a console window for … Read more

How to resize Image in C# WinRT/winmd?

Example of how to scale and crop taken from here: async private void BitmapTransformTest() { // hard coded image location string filePath = “C:\\Users\\Public\\Pictures\\Sample Pictures\\fantasy-dragons-wallpaper.jpg”; StorageFile file = await StorageFile.GetFileFromPathAsync(filePath); if (file == null) return; // create a stream from the file and decode the image var fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read); BitmapDecoder decoder = await … Read more

Get the active color of Windows 8 automatic color theme

Yes, it’s possible. However be warned: this encompasses quite a bit of Win32 interop (this means P/Invokes into native DLLs from managed code), and is only doable with certain undocumented APIs. Although, the only undocumented features involved are for obtaining the window color scheme (or as the DWM calls it, the window colorization color), which … Read more

MessageDialog ShowAsync throws accessdenied exception on second dialog

Okay I found a quick solution, define a IAsyncOperation class varialble IAsyncOperation<IUICommand> asyncCommand = null; and set it to the ShowAsync method of MessageDialog asyncCommand = msg.ShowAsync(); In the command handler for retry/try again check if asyncCommand is not null and cancel the last operation if necessary if(asyncCommand != null) { asyncCommand.Cancel(); } Please let … Read more