Hi Antonio,
how can we implement SHCreateMenuBar command in FWPPC ?
We have modified the example with TB_STYLEBUTTON but it doesn't works.
Have you an working menu CE 6.0 example compiled with FWPPC ?
regards
HB_FUNC( CESETMENU )
{
HWND hWnd = ( HWND ) hb_parnl( 1 );
static SHMENUBARINFO mbi;
memset( &mbi, 0, sizeof( SHMENUBARINFO ) );
mbi.cbSize = sizeof( SHMENUBARINFO );
mbi.hwndParent = hWnd;
mbi.nToolBarId = hb_parnl( 2 );
mbi.hInstRes = GetModuleHandle( NULL );
mbi.nBmpId = hb_parnl( 3 );
mbi.cBmpImages = hb_parnl( 4 );
SHCreateMenuBar( &mbi );
hb_retnl( SendMessage( mbi.hwndMB, SHCMBM_GETMENU, 0, 0 ) );
}
#include "FWCE.ch"
#define MF_BYCOMMAND 0
#define MF_ENABLED 0
#define MF_STRING 0
//----------------------------------------------------------------------------//
function Main()
local oWnd, hMenu
DEFINE WINDOW oWnd TITLE "TestMenu" ;
MENU BuildMenu()
oWnd:oMenu:hMenu = CreateMenu()
MyAppendMenu( oWnd:oMenu:hMenu, nOr( MF_BYCOMMAND, MF_ENABLED, MF_STRING ),;
110, "First" )
MyAppendMenu( oWnd:oMenu:hMenu, nOr( MF_BYCOMMAND, MF_ENABLED, MF_STRING ),;
120, "Second" )
MyAppendMenu( oWnd:oMenu:hMenu, nOr( MF_BYCOMMAND, MF_ENABLED, MF_STRING ),;
130, "Third" )
MsgInfo( MyCESetMenu( oWnd:hWnd, oWnd:oMenu:hMenu ) )
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function BuildMenu()
local oMenu, oItem
DEFINE MENU oMenu RESOURCE 102
REDEFINE MENUITEM oItem ID 110 OF oMenu ACTION ( MsgInfo( "Clientes" ), oItem:SetCheck( .t. ) )
REDEFINE MENUITEM ID 120 OF oMenu ACTION MsgInfo( "Proveedores" ) WHEN .F.
REDEFINE MENUITEM ID 1310 OF oMenu ACTION MsgInfo( "Añadir" )
REDEFINE MENUITEM ID 1320 OF oMenu ACTION MsgInfo( "Modificar" )
REDEFINE MENUITEM ID 210 OF oMenu ACTION MsgInfo( "Albaranes" )
REDEFINE MENUITEM ID 310 OF oMenu ACTION MsgInfo( "Manual" )
return oMenu
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
typedef struct _CONTEXT CONTEXT, *PCONTEXT;
#include <windows.h>
#include <aygshell.h>
#include <sipapi.h>
#include <shlobj.h>
#include <fwppc.h>
HB_FUNC( CREATEMENU )
{
hb_retnl( ( HB_LONG ) CreateMenu() );
}
HB_FUNC( MYAPPENDMENU )
{
LPWSTR pW = ( LPWSTR ) AnsiToWide( ( char * ) hb_parc( 4 ) );
hb_retl( AppendMenu( ( HMENU ) hb_parnl( 1 ), hb_parnl( 2 ), hb_parnl( 3 ), pW ) );
hb_xfree( pW );
}
HB_FUNC( MYCESETMENU )
{
static SHMENUBARINFO mbi;
memset( &mbi, 0, sizeof( SHMENUBARINFO ) );
mbi.cbSize = sizeof( SHMENUBARINFO );
mbi.hwndParent = ( HWND ) hb_parnl( 1 );
mbi.nToolBarId = hb_parnl( 2 );
mbi.hInstRes = GetModuleHandle( NULL );
mbi.nBmpId = hb_parnl( 3 );
mbi.cBmpImages = hb_parnl( 4 );
mbi.dwFlags = SHCMBF_HMENU;
SHCreateMenuBar( &mbi );
hb_retnl( SendMessage( mbi.hwndMB, SHCMBM_GETMENU, 0, 0 ) );
}
#pragma ENDDUMP
#include "Fwce.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd
@ 20, 0 BUTTON "First" SIZE 70, 20 OF oWnd
@ 20, 11.5 BUTTON "Second" SIZE 70, 20 OF oWnd
@ 20, 23 BUTTON "Third" SIZE 70, 20 OF oWnd
ACTIVATE WINDOW oWnd
return nil
Return to FiveWin for Pocket PC
Users browsing this forum: No registered users and 16 guests