Posts

Showing posts from April, 2012

My Metroapp is not showing images!

If you're working in code-behind, are trying to load an included BitmapImage and your app, although it loads, is not showing the image, it might be because you're not using the appropriate protocol. In the Windows 8 Consumer Preview, the correct protocol for loading included images is ms-appx: BitmapImage img = new BitmapImage(new Uri("ms-appx:///Images/my_image.png", UriKind.RelativeOrAbsolute)); In the above case, the image is set as Content (for C#-projects; Image  for C++ ones) and resides in the Images solution folder. For more information about loading images, please see Microsoft's official sample  App tiles and badges sample .

Programmatically show and hide the Windows taskbar

I've been working on an application launcher for multi-touch surfaces. As a part of the experience, I wanted to hide the Windows taskbar, as it didn't feel very 360 degrees - multi-touch - multi-user , as was the intention of my launcher. Anyway, this is what I compiled: WPF App Constructor         public App()         {             ViewModel = new AppViewModel();             _systemTrayHandle = FindWindow("Shell_traywnd", "");             _startButtonHandle = FindStartButton();         } Imports         #region Windows API Imports & Utilities         [DllImport("user32.dll", SetLastError = true)]         static extern IntPtr FindWindow(string lpClassName, string lpWindowName);         [DllImport("user32.dll")]         [return: MarshalAs(UnmanagedType.Bool)]         static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);         [DllI