locked
Is it possible to access a Windows Message (WM_ ) from a WinRT component in C++/CX

    Question

  • I would like to listen for a windows message inside a WinRT component. This message is WM_DEVICECHANGE and I'm interested in 2 message parameters: DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE in order to know if a device has been plugged or removed.

    I have read that Windows store applications don't have any more the a windows message pump, but I would like to understand how an application like that can deal with devices?

    If there is a new way to listen to this kind of information from the system I'd like to know how!

    Thanks by advance
    O. ROUIT

     


    Software Architect, Advanced IT Tokens Team - Gemalto

    Saturday, December 1, 2012 11:13 AM

All replies

  • Looks like the objects in Windows.Devices could help me solve my previous problem.

    However I'm now facing another more important one!

    I wanted to access the PC/SC APIs that are defined in <winscard.h> but it looks like all those APIs are not accessible when building a WinRT component for the Windows store.

    A WinRT components define WINAPI_FAMILY=WINAPI_FAMILY_APP and when this value if defined, the APIs of Wnscard are simply invisible to the compiler.

    I found in another forum that smartcard APIs are only accessible from the desktop with Windows 8, which means that Metro app cannot access a smartcard resource.

    So my question is the following:

    How can a windows store application read/write data from a smartcard?? If it is not possible, can someone of Microsoft give a reason for Windows store App to exist under Windows 8???!!!

    Thanks

    O. ROUIT


    Software Architect, Advanced IT Tokens Team - Gemalto

    Saturday, December 1, 2012 1:13 PM
  • Hi,

    The smart card API cannot be used in Window  Store App.
    http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/85b19a4b-4121-4336-86bb-a0474b5a90c3/

    Only a part of Win32 API can be used in Windows Store App. Here is the list
    http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx

    Best regards,
    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, December 5, 2012 11:19 AM