29

Can non-Metro Windows apps (ex: Explorer) be built with the new WinRT, or must they still be Win32 based?

Kate Gregory
  • 18,808
  • 8
  • 56
  • 85
Dmitry Sychov
  • 237
  • 7
  • 16
  • 1
    I think this is very **on-topic** as I have wondered the same thing. – jondavidjohn Sep 19 '11 at 18:48
  • 1
    Why would you rewrite a million lines of alread-working code? – Gabe Sep 19 '11 at 18:48
  • 1
    maybe to clarify, are you asking, "Can non-metro, Windows apps be built with the new WinRT?" – jondavidjohn Sep 19 '11 at 18:49
  • @Gabe *"working"* is very subjective on this topic... ;) – jondavidjohn Sep 19 '11 at 18:49
  • 1
    @jon I'm not going to comment on whether or not this question is or is not off topic. But the fact that you have wondered the same thing does not make this on topic at SO. – David Heffernan Sep 19 '11 at 18:58
  • 2
    of course, replace the 'as' in my comment with a comma. I'm just not sure how this isn't code related, quantitative, and not subjective. – jondavidjohn Sep 19 '11 at 18:59
  • 1
    While I agree that the general idea is topical, I think it could probably be asked a bit better. I'd aim more for something like: "What (if any) restrictions does WinRT impose on applications?" – Jerry Coffin Sep 19 '11 at 19:27
  • Does this include services and server-side apps (like AppFabric auto-start apps) running on Windows Server 8? They can all access the 'Desktop' APIs? That's what is meant by 'non-Metro' vs just 'Desktop'? – yzorg Jul 09 '12 at 15:53

2 Answers2

26

I asked this during the 'Ask the Experts' session at //Build/. The answer was "Yes, within reason. Not all of the WinRT api's will function when called from desktop apps - for example any metro specific ones will fail. No explicit list of which ones work from desktop (non-metro) apps is available."

Edit: It appears that the documentation has been updated to provide a list of WinRT api's available from the desktop.

yzorg
  • 4,224
  • 3
  • 39
  • 57
Jon
  • 3,065
  • 1
  • 19
  • 29
  • 2
    The UI-related stuff (`Windows.UI.Xaml`) will definitely not work. – Pavel Minaev Sep 19 '11 at 21:39
  • 1
    I will not be surprised to discover the WinRT as a wrapper over system calls - hardly see MS supporting 2 sets of kernel-level APIs. – Dmitry Sychov Sep 19 '11 at 23:14
  • 4
    It was made pretty clear that WinRT and Win32 use the same core system internals, but WinRT is not built on Win32 – Jon Sep 20 '11 at 15:56
  • If there will be no access to HDC, such WinRT-based apps will differ from "legacy" GDI based desktop apps at least in font rendering which can be quite noticeable and sensitive. My question on this topic: http://stackoverflow.com/questions/7487080/winrt-and-software-cleartype-font-rendering – Dmitry Sychov Sep 20 '11 at 17:35
  • 1
    @Jon: actually it appears that WinRT is indeed a wrapper over Win32. See: http://getwired.com/2011/09/20/win32-the-reports-of-my-death-are-greatly-exaggerated/ – Dmitry Sychov Sep 20 '11 at 18:31
  • 2
    @DmitrySychov I read the article and several that it references. The message I get from them is "Win32 is not dead", which is substantially different from "WinRT is a wrapper around Win32". I do see some claims about the entirety of WinRT being a wrapper around explorer.exe in the primary article, which is quite frankly a bit bizarre. – Jon Sep 20 '11 at 19:10
  • 8
    Some Windows Runtime APIs are thin wrappers around existing Win32 APIs (XML and the sensor APIs, for example). Some Windows Runtime APIs are completely new (the XAML APIs and the input stack). So it's not true to say that the windows runtime is a wrapper around Win32, but it is true that parts of the windows runtime are layered on top of Win32. – Larry Osterman Sep 24 '11 at 14:25
  • @Larry - Thanks for providing an authoritative answer. I guess I missed some of the nuance while I was at //Build/ – Jon Sep 25 '11 at 14:04
  • @Jon: Your original answer is just fine (it's spot on actually). I was just clarifying the "Win32 is not dead" aspect. – Larry Osterman Sep 25 '11 at 20:47
  • Did they ever release this list? – Cody C Apr 18 '12 at 16:01
  • 2
    @CodyC Try the tail end of [this page](http://msdn.microsoft.com/en-us/library/windows/desktop/hh405363%28v=vs.85%29.aspx). – Jon Apr 18 '12 at 17:02
3

From "Dev Center - Metro style apps"

A sticky posted by moderator on Thursday, November 03, 2011 1:16 AM

We have received a number of inquiries in this area. The documentation will be expanding as the Windows 8 project progresses to include more API specific details. It is possible to use WinRT from Desktop applications. WinRT APIs may be tied to Metro style apps, Desktop apps or potentially available to both. The documentation will list which environments (Desktop, Metro style or both) a given API works in. Note: Custom WinRT components are only supported in Metro style applications. They are not supported in Desktop applications.

Michael Olesen
  • 473
  • 2
  • 9