I tried a modified version of progres1.prg that create a progress bar directly, in this way:
- Code: Select all Expand view
- #include "FiveWin.ch"
function Main()
local oDlg, oProg1, oProg2
DEFINE DIALOG oDlg TITLE "Progress Bars"
@ 1, 1 PROGRESS oProg1 SIZE 80, 12
@ 1, 20 PROGRESS oProg2 SIZE 12, 50 VERTICAL
@ 3, 9 BUTTON "Ok" ACTION oDlg:End()
oDlg:bStart = { || Increase( oProg1, oProg2 ) }
ACTIVATE DIALOG oDlg CENTER ;
ON INIT ( oProg1:SetRange( 0, 100 ), oProg1:SetStep( 1 ),;
oProg2:SetRange( 0, 100 ), oProg2:SetStep( 1 ), ;
CREATEPROGRESS(oDlg:hWnd) )
return nil
function Increase( oProg1, oProg2 )
local n
for n = 1 to 11
oProg1:SetPos( n*10 )
oProg2:SetPos( n*10 )
Sleep( 50 )
SysRefresh()
next
return nil
//*
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
#include <CommCtrl.h>
HB_FUNC( CREATEPROGRESS )
{
#ifndef _WIN64
HWND hWnd = ( HWND ) hb_parnl( 1 );
#else
HWND hWnd = ( HWND ) hb_parnll( 1 );
#endif
HWND hProgress = CreateWindow("msctls_progress32", "progress", WS_CHILD | WS_VISIBLE | WS_TABSTOP |PBS_SMOOTH, 12, 80, 160, 24, hWnd, 0,
(HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE), 0);
SendMessage(hProgress, PBM_SETPOS, 50, 0);
hb_retnl(1);
}
#pragma ENDDUMP
What i see, is the the direct create window has an animation (on windows 10) the other 2 does not.
I tried to fix it and I was not able to do it
any idea?