FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with the TREBAR class on Windows XP (solved)
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Problem with the TREBAR class on Windows XP (solved)
Posted: Wed Oct 30, 2019 06:39 AM
Dear All,

I encountered a problem with the TREBAR class on Windows XP with the latest version of Fivewin.
I know that Windows XP is an outdated operating system but unfortunately I still have clients who use it.
To check the problem, simply compile rebars.prg file in the samples folder.

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

聽 聽local oWnd, oReBar, oToolBar, oPanel, oBtn1, oFolder, oToolBar2
聽 聽local oImageList, oHand

聽 聽DEFINE WINDOW oWnd TITLE "Testing rebars and toolbars" ;
聽 聽 聽 MENU BuildMenu()

聽 聽DEFINE CURSOR oHand RESOURCE "hand"

聽 聽oReBar = TReBar():New( oWnd )

聽 聽oPanel := TPanel():New( 0, 0, 75, 300, oReBar )

聽 聽oImageList = TImageList():New()

聽 聽oImageList:AddMasked( TBitmap():Define( , "..\bitmaps\16x16\new2.bmp", oWnd ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽nRGB( 255, 0, 255 ) ) 聽 聽
聽 聽oImageList:AddMasked( TBitmap():Define( , "..\bitmaps\16x16\open2.bmp", oWnd ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽nRGB( 255, 0, 255 ) ) 聽 聽
聽 聽
聽 聽oImageList:Add( TBitmap():Define( , "..\bitmaps\16x16\icon.bmp", oWnd ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽TBitmap():Define( , "..\bitmaps\16x16\icoMask.bmp", oWnd ) )

聽 聽oToolBar = TToolBar():New( oPanel, 33, 33, oImageList )
聽 聽oToolBar:nLeft = 5
聽 聽oToolBar:AddButton( { || MsgInfo( "New" ) }, "New" ) // , "new file" )
聽 聽oToolBar:AddButton( { || MsgInfo( "Open" ) }, "Open" )
聽 聽oToolBar:AddButton( { || MsgInfo( "three" ) }, "three" )
聽 聽oToolBar:AddSeparator()
聽 聽oToolBar:AddButton( { || MsgInfo( "four" ) }, "four" )
聽 聽oToolBar:oCursor = oHand 

聽 聽oReBar:InsertBand( oPanel )

聽 聽@ 10, 2 FOLDER oFolder PROMPTS "One", "Two", "Three" SIZE 400, 62

聽 聽oToolBar2 = TToolBar():New( oFolder:aDialogs[ 1 ],,, oImageList )
聽 聽oToolBar2:AddButton( { || MsgInfo( "pointer" ) }, "pointer" )
聽 聽oToolBar2:AddSeparator()
聽 聽oToolBar2:AddButton( ,"label" )
聽 聽oToolBar2:AddButton( ,"button" )

聽 聽oReBar:InsertBand( oFolder )

聽 聽DEFINE STATUSBAR OF oWnd PROMPT "Rebars and Toolbars test"

聽 聽ACTIVATE WINDOW oWnd MAXIMIZED
聽 聽
聽 聽oImageList:End()

return nil

FUNCTION BuildMenu()

聽 聽LOCAL oMenu

聽 聽MENU oMenu
聽 聽 聽 MENUITEM "&File"
聽 聽 聽 MENU
聽 聽 聽 聽 聽MENUITEM "&New..." ACTION MsgInfo( "Hello" )
聽 聽 聽 ENDMENU
聽 聽ENDMENU

RETURN oMenu


Code (fw): Select all Collapse
// Add this to your resources RC file

#ifndef __64__
聽 聽1 24 ".\WinXP\WindowsXP.Manifest"
#endif

#ifdef __64__
聽 聽1 24 "WinXP/WindowsXP.Manifest64"
#endif 

Hand 聽 聽 CURSOR .\..\cursors\Hand.cur


Tools used:
Fivewin 19.09
Borland 5.82

Can someone help me ?


Thanks
Massimo
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 06:57 AM

Massimo,

Could you please post a screenshot or send it to my email ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 08:25 AM
This is the screenshot in Windows 10



This is the screenshot in Windows XP (in practice the bar is not displayed)



Thanks
Massimo
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 08:35 AM

Please, Do not use manifest file in your resource file and try both operating systems

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 08:51 AM
In Windows 10 without the manifest file

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 09:26 AM

Hello Cristobal,

if I not use manifest file, the bar does not appear in windows 10 and does not appear in windows xp,
the strange thing is that in the old version of fivewin it worked.

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 09:30 AM

What version did you use before?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 09:38 AM

An old version, the 7.01, I don't know from which version the problem started

Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 09:42 AM
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Oct 30, 2019 09:43 AM
MaxP wrote:An old version, the 7.01, I don't know from which version the problem started


Ok Massimo. Please wait
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Nov 06, 2019 07:18 AM

Hello Cristobal,

are there any news respect to this problem?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Nov 06, 2019 07:51 AM

Massimo,

Could you please post a screenshot how it looks with XP and using FWH 7.01 ?

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Wed Nov 06, 2019 08:36 AM
This is the screenshot how it looks with XP and using FWH 7.01



This is the screenshot how it looks with XP and using FWH 19.09



Thanks
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem with the TREBAR class on Windows XP
Posted: Fri Nov 08, 2019 05:09 PM
Bug fixed:

The key to solve it is this line at that specific location:
#define _WIN32_WINNT 0x0500

Please add this code to samples\rebars.prg

Code (fw): Select all Collapse
#pragma BEGINDUMP

#define _WIN32_WINNT 0x0500
#include <Windows.h>
#include <hbapi.h>
#include <commctrl.h>

HB_FUNC( RBINSERTBAND ) // hReBar, hControl, cText
{
聽 聽#ifndef _WIN64
聽 聽 聽 HWND hReBar = ( HWND ) hb_parnl( 1 );
聽 聽 聽 HWND hControl = ( HWND ) hb_parnl( 2 );
聽 聽#else 聽 
聽 聽 聽 HWND hReBar = ( HWND ) hb_parnll( 1 );
聽 聽 聽 HWND hControl = ( HWND ) hb_parnll( 2 );
聽 聽#endif 聽 
聽 聽REBARBANDINFO rbinfo;
聽 聽RECT rct;

聽 聽GetWindowRect( hControl, &rct );

聽 聽memset( ( char * ) &rbinfo, 0, sizeof( REBARBANDINFO ) );
聽 聽rbinfo.cbSize = sizeof( REBARBANDINFO );
聽 聽rbinfo.fMask = RBBIM_TEXT | RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE |
聽 聽 聽 聽 聽 聽 聽 聽 聽 RBBIM_SIZE;
聽 聽rbinfo.fStyle = RBBS_CHILDEDGE;
聽 聽rbinfo.lpText = ( LPSTR ) hb_parc( 3 );
聽 聽rbinfo.hwndChild = hControl;
聽 聽rbinfo.cxMinChild = rct.right - rct.left;
聽 聽rbinfo.cyMinChild = rct.bottom - rct.top;
聽 聽rbinfo.cx = rct.right - rct.left;

聽 聽SendMessage( hReBar, RB_INSERTBAND, ( WPARAM ) -1, ( LPARAM ) &rbinfo );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 99
Joined: Thu Jul 12, 2007 02:02 PM
Re: Problem with the TREBAR class on Windows XP (solved)
Posted: Mon Nov 11, 2019 08:26 AM

Hi Antonio,

now it works properly, thank you for your professionalism

Massimo