locked
WndProc in Metro style apps RRS feed

  • Question

  • Hi,

    I am trying to migrate my desktop application to Metro style, which is overriding WndProc to collect the information of WM_POINTER messages.

    However I couldn't find the corresponding namespace in WinRT libraries.. either System.Windows.Forms.Message (Winform) or System.Windows.Interop.HwndSource (WPF)

    Does anyone have experience to deal with it? Any clue will be appreciated.

    Friday, October 14, 2011 4:04 AM

Answers


  • Hi Allen,

    The Windows.UI.Xaml.Input.PointerEventArgs provide the same information as is available in the native WM_POINTER* events. The Windows.Ui.Input.PointerPoint provides further information similar to what is available in the POINTER_INFO structure.

    --Rob

    Monday, October 17, 2011 7:27 AM
    Moderator

All replies

  • Hi Allen,

    There is no WndProc in Metro style apps and no window messages.  Instead, handle the pointer events directly.  See http://msdn.microsoft.com/en-us/library/windows/apps/hh465387(v=VS.85).aspx#using_pointer_events for more details.

    In general the recommendation is to redesign the app's UI to fit the Metro design language rather than to attempt a direct port of an existing desktop app.

    --Rob

    Friday, October 14, 2011 6:48 AM
    Moderator
  • Thank you Rob, but I found the properties available in pointer class are very limited, is it possible to get pointer's further information? Such as raw location, predicted location, flags, pressure, actual count...etc.? Many thanks!
    Friday, October 14, 2011 7:58 AM

  • Hi Allen,

    The Windows.UI.Xaml.Input.PointerEventArgs provide the same information as is available in the native WM_POINTER* events. The Windows.Ui.Input.PointerPoint provides further information similar to what is available in the POINTER_INFO structure.

    --Rob

    Monday, October 17, 2011 7:27 AM
    Moderator