Why is there so much change in the Windows API? RRS feed

  • Question

  • I've been writing apps based on Windows for a few years now, but of late I'm getting quite frustrated, as trying to find out how to do some quite simple things in Windows has become a very lengthy and laborious process.

    For example, I am currently developing a Windows 8.1 Store App and am trying to get a TextBox containing a long text string, to instantiate with the text scrolled to the end.  So I look for TextBox.AppendText method and it's no longer available.  I look for TextBox.ScrollToCaret() and again it's no longer available.

    I then look on MSDN and other on-line resources and start to realise that there isn't an answer to this and I'm probably going to have to use another control or write some custom code to do something that should be very easy... namely, display scrollable text in a box!

    There has got to be a better way to develop software than endless cycles of trial and error?

    I'd like an answer to my TextBox issue, but as this isn't the only example of such changeability in the code base, I'd also like to know if I'm wasting my time in developing for the Windows Store and perhaps should stay with Windows Forms or WPF and wait until the latest code base has matured?

    Saturday, December 20, 2014 2:12 AM


  • Please post the TextBox issue that you want help with on its own thread with a clear description of what you are trying to do. It is difficult to separate the technical question from the general comments.

    If you watch the videos from the Build 2011 conference there are several that discuss the theory that when into which API to expose for Windows Runtime apps and which not to. The basic goal was to simplify the API surface and not provide several different ways to do the same thing. Krzysztof Cwalina's talk A .NET developer's view of Windows 8 app development is a good one along these lines. The API set has matured since then (Build 2011 was the initial release of an early developer preview), but the basic concepts are the same.

    TextBox.ScrollToCaret is (I believe) a Windows Forms function (it isn't available in either WPF or Silverlight). There is very little relation between Windows Forms and Windows.UI.Xaml. The overall concepts of the two libraries are very different.

    Windows.UI.Xaml is in the Xaml family of frameworks along with WPF, Silverlight, and Silverlight for the Phone. WPF is its most distant relation. Silverlight for the Phone is the closest. The overall Xaml concepts are the same, but some of the implementations are a bit different (especially between WPF and Silverlight) and the control sets are designed for the different design languages.

    You can find all of the documentation for writing Windows Store and Windows Phone apps in the Windows Dev Center at http://dev.windows.com . There are how to and reference sections, and you can filter your searches to just the appropriate documentation sets. If you look more broadly on MSDN, the API documentation pages should say if specific classes and methods apply to desktop or to Windows Store apps.

    Saturday, December 20, 2014 2:45 AM