TB_ENABLE( oMenu:hMenu, oMenuItem:nId )
TB_DISABLE( oMenu:hMenu, oMenuItem:nId )
HB_FUNC( TB_DISABLE )
{
HWND hMenuBar = (HWND)SHFindMenuBar(hb_parnl(1));
TBBUTTONINFO tbbi;
tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_STATE;
tbbi.fsState = TBSTATE_INDETERMINATE;
SendMessage( hMenuBar, TB_SETBUTTONINFO, hb_parnl( 2 ), ( LPARAM ) &tbbi );
return;
}
HB_FUNC ( TB_ENABLE )
{
HWND hMenuBar = ( HWND ) SHFindMenuBar( hb_parnl( 1 ) );
TBBUTTONINFO tbbi;
tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_STATE;
tbbi.fsState = TBSTATE_ENABLED;
SendMessage( hMenuBar, TB_SETBUTTONINFO, hb_parnl( 2 ), ( LPARAM ) &tbbi);
return;
}
#include "FWCE.ch"
static oMenuItem1, oMenuItem2, oMenu
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "TestMenu" ;
MENU BuildMenu()
@ 0, 0 button "Disable" size 100, 20 action oMenuItem1:Disable() pixel
@ 30, 0 button "Enable" size 100, 20 action oMenuItem1:Enable() pixel
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function BuildMenu()
DEFINE MENU oMenu RESOURCE 102
REDEFINE MENUITEM oMenuItem1 ID 110 OF oMenu ACTION MsgInfo( "First" )
REDEFINE MENUITEM oMenuItem2 ID 120 OF oMenu ACTION MsgInfo( "Second" )
return oMenu
//----------------------------------------------------------------------------//
Return to FiveWin for Pocket PC
Users browsing this forum: No registered users and 5 guests