Code: Select all
#include <hmg.ch>
Function Main
Load Window Main
Main.Center
Main.Activate
Return
Func CMenu()
Local hMenu := _GetMenuId(GetFormHandle("MAIN"))
Local aColor := {255,255,255}
Local lSubMenu := .F.
_ColorMenu(GetFormHandle("MAIN"),aColor, lSubMenu)
Return Nil
#pragma BEGINDUMP
#include <windows.h>
#include <commctrl.h>
#include "hbapi.h"
#include "hbvm.h"
#include "hbstack.h"
#include "hbapiitm.h"
#include "winreg.h"
#include "tchar.h"
HB_FUNC( _GETMENUID)
{
hb_retnl((LONG)GetMenu((HWND)hb_parnl(1)));
}
HB_FUNC ( _COLORMENU )
{
HMENU iMenu;
MENUINFO iMenuInfo ;
COLORREF lColor = {255,255,255};
BOOL lSubMenu = hb_parl(3);
iMenu = GetMenu((HWND) hb_parnl(1));
GetMenuInfo(iMenu, &iMenuInfo);
iMenuInfo.cbSize = sizeof(MENUINFO);
iMenuInfo.hbrBack = CreateSolidBrush(lColor);
SetMenuInfo(iMenu, &iMenuInfo);
if (lSubMenu)
{
iMenuInfo.fMask = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS ;
}
else
{
iMenuInfo.fMask = MIM_BACKGROUND;
}
SetMenuInfo(iMenu, &iMenuInfo);
}
HB_FUNC ( _COLORSUBMENU )
{
HMENU iMenu;
MENUINFO iMenuInfo ;
iMenu = GetMenu((HWND) hb_parnl(1));
GetMenuInfo(iMenu, &iMenuInfo);
iMenuInfo.cbSize = sizeof(MENUINFO);
iMenuInfo.fMask = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS;
iMenuInfo.hbrBack = CreateSolidBrush(RGB(hb_parni(2,1),hb_parni(2,2),hb_parni(2,3)));
SetMenuInfo(iMenu, &iMenuInfo);
DrawMenuBar((HWND) hb_parnl(1));
}
#pragma ENDDUMP
error build.log
hbmk2: Harbour: Compilando m¢dulos...
Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/
hbmk2: Compilando...
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg: In function 'HB_FUN__COLORMENU':
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:42:1: warning: excess elements in scalar initializer
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:42:1: warning: (near initialization for 'lColor')
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:42:1: warning: excess elements in scalar initializer
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:42:1: warning: (near initialization for 'lColor')
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:59:25: error: 'MIM_BACKGROUND' undeclared (first use in this function)
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:59:25: note: each undeclared identifier is reported only once for each function it appears in
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:59:42: error: 'MIM_APPLYTOSUBMENUS' undeclared (first use in this function)
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg: In function 'HB_FUN__COLORSUBMENU':
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:82:22: error: 'MIM_BACKGROUND' undeclared (first use in this function)
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:82:39: error: 'MIM_APPLYTOSUBMENUS' undeclared (first use in this function)
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:83:1: error: too many arguments to function 'hb_parni'
C:/HMG3.0.38/harbour/include/hbapi.h:637:31: note: declared here
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:83:1: error: too many arguments to function 'hb_parni'
C:/HMG3.0.38/harbour/include/hbapi.h:637:31: note: declared here
K:\@Prog-Xbase\HMG-3038\Projetos\HMGFORUM\Menucolor\main.prg:83:1: error: too many arguments to function 'hb_parni'
C:/HMG3.0.38/harbour/include/hbapi.h:637:31: note: declared here
hbmk2: Erro: Executando compilador C/C++. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -W -Wall -pipe -IC:/HMG3.0.38/harbour/include -I../../.. -IC:/HMG3.0.38/include ../../../.hbmk/win/mingw/main.c
[u]Moderator Notes[/u] (Pablo César) wrote:Topic moved from Forum en Español.