Problem with the TREBAR class on Windows XP (solved)

Problem with the TREBAR class on Windows XP (solved)

Postby MaxP » Wed Oct 30, 2019 6: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: Select all  Expand view
#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: Select all  Expand view
// 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
Last edited by MaxP on Mon Nov 11, 2019 8:24 am, edited 1 time in total.
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with the TREBAR class on Windows XP

Postby Antonio Linares » Wed Oct 30, 2019 6:57 am

Massimo,

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

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

Re: Problem with the TREBAR class on Windows XP

Postby MaxP » Wed Oct 30, 2019 8:25 am

This is the screenshot in Windows 10

Image

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

Image

Thanks
Massimo
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with the TREBAR class on Windows XP

Postby cnavarro » Wed Oct 30, 2019 8: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with the TREBAR class on Windows XP

Postby cnavarro » Wed Oct 30, 2019 8:51 am

In Windows 10 without the manifest file

Image
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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with the TREBAR class on Windows XP

Postby MaxP » Wed Oct 30, 2019 9: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.
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with the TREBAR class on Windows XP

Postby cnavarro » Wed Oct 30, 2019 9: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with the TREBAR class on Windows XP

Postby MaxP » Wed Oct 30, 2019 9:38 am

An old version, the 7.01, I don't know from which version the problem started
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with the TREBAR class on Windows XP

Postby MaxP » Wed Oct 30, 2019 9:42 am

User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with the TREBAR class on Windows XP

Postby cnavarro » Wed Oct 30, 2019 9: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with the TREBAR class on Windows XP

Postby MaxP » Wed Nov 06, 2019 7:18 am

Hello Cristobal,

are there any news respect to this problem?
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with the TREBAR class on Windows XP

Postby Antonio Linares » Wed Nov 06, 2019 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with the TREBAR class on Windows XP

Postby MaxP » Wed Nov 06, 2019 8:36 am

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

Image

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

Image

Thanks
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Re: Problem with the TREBAR class on Windows XP

Postby Antonio Linares » Fri Nov 08, 2019 5: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: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with the TREBAR class on Windows XP (solved)

Postby MaxP » Mon Nov 11, 2019 8:26 am

Hi Antonio,

now it works properly, thank you for your professionalism

Massimo
User avatar
MaxP
 
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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