Windows 10 Icons of program

Windows 10 Icons of program

Postby Marc Vanzegbroeck » Sun Aug 28, 2016 3:39 pm

Hi,

I'm wondering how to create a 'Full Bleed' icon for a FWH-program like described in https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-app-assets
Now I link a 32x32 icon in my RC-file, and if I connect it to windows 10 start-menu, I get somethink like the left icon
How to create something like the right?
Image
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Windows 10 Icons of program

Postby AntoninoP » Mon Sep 12, 2016 3:25 pm

In this sample uses the notification API: https://code.msdn.microsoft.com/windowsapps/Simple-Live-Tiles-575b1d66
Maybe the code of toast can be updated to be used in it.
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Windows 10 Icons of program

Postby Antonio Linares » Mon Sep 12, 2016 4:34 pm

Antonino,

How ? :-)

Code: Select all  Expand view
       private void SetLiveTile()
        {
            var LiveTile = @"<tile>
                                <visual version="
"1"">
                                  <binding template="
"TileWideText03"">
                                    <text id="
"1"">My first own wide tile notification!</text>
                                  </binding>
                                  <binding template="
"TileSquareText04"">
                                    <text id="
"1"">My first own small tile notification!</text>
                                  </binding>
                                </visual>
                              </tile>"
;

            XmlDocument tileXml = new XmlDocument();
            tileXml.LoadXml(LiveTile);

            var tileNotification = new Windows.UI.Notifications.TileNotification(tileXml);
            Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
        }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42069
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Windows 10 Icons of program

Postby AntoninoP » Tue Sep 13, 2016 8:48 am

Antonino ;)

Here a modified version of your example about toast:

Code: Select all  Expand view

#include "FiveWin.ch"

#define CLSCTX_ALL 0x17
#define LoadXML 66
#define CreateTileUpdaterForApplication 7
#define Update 7

function Main()

   local oWnd

   DEFINE WINDOW oWnd

   ACTIVATE WINDOW oWnd ;
      ON INIT Test(  )

return nil

function Test()
   local pString, cIID, cUIID, pTileUpdateManager, pXML, pTileNotificationFactory, pTileNotification, pTileUpdater
   
   // F6D90F11-9C73-11D3-B32E-00C04F990BB4"
   cIID = Chr( 0x11 ) + Chr( 0x0F ) + Chr( 0xD9 ) + Chr( 0xF6 ) + ;
       Chr( 0x73 ) + Chr( 0x9C ) + Chr( 0xD3 ) + Chr( 0x11 ) + ;
       Chr( 0xB3 ) + Chr( 0x2E ) + Chr( 0x00 ) + Chr( 0xC0 ) + ;
       Chr( 0x4F ) + Chr( 0x99 ) + Chr( 0x0B ) + Chr( 0xB4 )
   // 2933BF81-7B36-11d2-B20E-00C04F983E60
   cUIID = Chr( 0x81 ) + Chr( 0xBF ) + Chr( 0x33 ) + Chr( 0x29 ) + ;
          Chr( 0x36 ) + Chr( 0x7B ) + Chr( 0xd2 ) + Chr( 0x11 ) + ;
          Chr( 0xB2 ) + Chr( 0x0E ) + Chr( 0x00 ) + Chr( 0xC0 ) + ;
          Chr( 0x4F ) + Chr( 0x98 ) + Chr( 0x3E ) + Chr( 0x60 )
   
   CoCreateInstance(cIID, 0, CLSCTX_ALL, cUIID, @pXML )
   pString = WinRTString( '<tile>'+ ;
                                '<visual version="1">'+ ;
                                '<binding template="TileWideText03">'+ ;
                                '<text id="1">My first own wide tile notification!</text>'+ ;
                                '</binding>'+ ;
                                '<binding template="TileSquareText04">'+ ;
                                '<text id="1">My first own small tile notification!</text> '+ ;
                                '</binding>'+ ;
                                '</visual>'+ ;
                                '</tile>' )
   WinRTMethod(pXML, LoadXML, pString, 0 )  
   WindowsDeleteString( pString );
   
   pString = WinRTString( "Windows.UI.Notifications.TileNotification" )

   // "C6ABDD6E-4928-46C8-BDBF-81A047DEA0D4"
   cIID = Chr( 0x6E ) + Chr( 0xDD ) + Chr( 0xAB ) + Chr( 0xC6 ) + ;
       Chr( 0x28 ) + Chr( 0x49 ) + Chr( 0xC8 ) + Chr( 0x46 ) + ;
       Chr( 0xBD ) + Chr( 0xBF ) + Chr( 0x81 ) + Chr( 0xA0 ) + ;
       Chr( 0x47 ) + Chr( 0xDE ) + Chr( 0xA0 ) + Chr( 0xD4 )

   RoGetActivationFactory( pString, cIID, @pTileNotificationFactory )
   WindowsDeleteString( pString )
   #define CreateTileNotification 7
   WinRTMethod(pTileNotificationFactory, CreateTileNotification, pXML, @pTileNotification )  

   pString = WinRTString( "Windows.UI.Notifications.TileUpdateManager" )

   // "DA159E5D-3EA9-4986-8D84-B09D5E12276D"
   cIID = Chr( 0x5D ) + Chr( 0x9E ) + Chr( 0x15 ) + Chr( 0xDA ) + ;
       Chr( 0xA9 ) + Chr( 0x3E ) + Chr( 0x86 ) + Chr( 0x49 ) + ;
       Chr( 0x8D ) + Chr( 0x84 ) + Chr( 0xB0 ) + Chr( 0x9D ) + ;
       Chr( 0x5E ) + Chr( 0x12 ) + Chr( 0x27 ) + Chr( 0x6D )

   RoGetActivationFactory( pString, cIID, @pTileUpdateManager )
   WindowsDeleteString( pString ) //*/
   
   WinRTMethod(pTileUpdateManager, CreateTileUpdaterForApplication, @pTileUpdater )  
   
   ? pTileUpdater
   
   if( pTileUpdater != 0)
      WinRTMethod(pTileUpdater, Update, pTileNotification )  
   endif
   
return nil

function WinRTString( cText )

   local pString
   WindowsCreateString( AnsiToWide( cText ), Len( cText ), @pString )

return pString

DLL FUNCTION RoInitialize( nType AS LONG ) AS LONG PASCAL LIB "combase.dll"

DLL FUNCTION RoUninitialize() AS VOID PASCAL LIB "combase.dll"

DLL FUNCTION WindowsCreateString( cWideText AS LPSTR, nLength AS LONG, @pString AS PTR ) ;
   AS LONG PASCAL LIB "combase.dll"
   
DLL FUNCTION WindowsDeleteString( pString AS PTR ) AS LONG PASCAL LIB "combase.dll"

DLL FUNCTION RoGetActivationFactory( pString AS PTR, REFIID AS LPSTR, @pFactory AS PTR ) ;
   AS LONG PASCAL LIB "combase.dll"

DLL FUNCTION CoCreateInstance( rclsid AS LPSTR, pUnkOuter AS PTR, dwClsContext AS DWORD, riid AS LPSTR,  @ppv AS PTR ) ;
   AS LONG PASCAL LIB "Ole32.dll"

#pragma BEGINDUMP

#include <Windows.h>
#include <hbapi.h>

#ifndef HB_LONGLONG
   #define HB_LONGLONG long
   #define hb_storvnll hb_stornl
#endif

typedef void * ( __stdcall * PMETHOD0 )( void * );
typedef void * ( __stdcall * PMETHOD1 )( void *, void * );
typedef void * ( __stdcall * PMETHOD2 )( void *, void *, void * );

HB_FUNC( WINRTMETHOD ) // pInspectable, nMethod, params...
{
   IUnknown * unknown = ( IUnknown * ) hb_parnll( 1 );
   void * pMethod = ( ( void ** ) unknown->lpVtbl )[ hb_parnl( 2 ) - 1 ];
   IUnknown * pReturn;

   switch( hb_pcount() )
   {
      case 3:
         if( HB_ISBYREF( 3 ) )
            hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, &pReturn ) );
         else
            hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD1 ) pMethod )( unknown, ( IUnknown * ) hb_parnll( 3 ) ) );
         break;

      case 4:
         if( HB_ISBYREF( 4 ) )
            hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), &pReturn ) );
         else
            hb_retnll( ( HB_LONGLONG ) ( ( PMETHOD2 ) pMethod )( unknown, ( void * ) hb_parnll( 3 ), ( IUnknown * ) hb_parnll( 4 ) ) );
         break;
   }

   if( HB_ISBYREF( 3 ) )
      hb_storvnll( ( HB_LONGLONG ) pReturn, 3 );

   if( HB_ISBYREF( 4 ) )
      hb_storvnll( ( HB_LONGLONG ) pReturn, 4 );
}  

#pragma ENDDUMP


the problem is that CreateTileUpdaterForApplication return nulls...
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Windows 10 Icons of program

Postby Antonio Linares » Tue Sep 13, 2016 8:53 am

thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42069
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests