Page 3 of 3
Re: CreateEllipticRgn / CreateRectRgn
Posted: Wed Nov 27, 2019 7:44 pm
by edk
AUGE_OHR wrote: ↑Wed Nov 27, 2019 4:53 am
other are Syntax with "."
list line work but
Code: Select all
hWnd := GETHWNDFROM(BMP_BAND1.Label_1)
fail with Syntax Error

... so how is the right Syntax to Get Handle of Control (not a API Question)
i guess i have to use a Macro for those Situation and that is what i want to find out before try a Big Application.
IMHO simplest way:
Code: Select all
hWndLabel_1 := BMP_BAND1.Label_1.Handle
OR
hWndLabel_1 := GetProperty('BMP_BAND1', 'Label_1', 'Handle')
OR
hWndLabel_1 := GetControlHandle ('Label_1', 'BMP_BAND1') //GetControlHandle (ControlName,ParentForm)
Re: CreateEllipticRgn / CreateRectRgn
Posted: Wed Nov 27, 2019 9:27 pm
by AUGE_OHR
hi,
edk wrote: ↑Wed Nov 27, 2019 7:44 pm
IMHO simplest way:
Code: Select all
hWndLabel_1 := BMP_BAND1.Label_1.Handle
OR
hWndLabel_1 := GetProperty('BMP_BAND1', 'Label_1', 'Handle')
OR
hWndLabel_1 := GetControlHandle ('Label_1', 'BMP_BAND1') //GetControlHandle (ControlName,ParentForm)
you are my Hero, THX

Re: CreateEllipticRgn / CreateRectRgn
Posted: Wed Dec 18, 2019 10:20 pm
by AUGE_OHR
hi,
i have try Sample with FiveWin and got a Error
Error E2140 hmg_uhr.prg 459: Declaration is not allowed here in function HB_FUN_BMP_PAINT
*** 1 errors in Compile ***
Code: Select all
HB_FUNC(BMP_PAINT)
{
HWND hWnd;
HBITMAP hBitmap;
HDC memDC, hDC;
RECT rect;
RECT aSource;
BITMAP bm;
int nMode;
hWnd = (HWND) hb_parnl (1);
hBitmap = (HBITMAP) hb_parnl (2);
nMode = hb_parni (3);
GetClientRect(hWnd, &rect);
458 // hDC = GetDC (hWnd); // obtine un hDC para toda el area del cliente (se puede pintar en cualquier lugar del area del cliente)
459 PAINTSTRUCT ps;
460 hDC = BeginPaint (hWnd, &ps); // obtiene un hDC solo para el area invalida (area que debe ser repintada) en un mensaje WM_PAINT
so i ask Antonio
In C code all variables declarations must go before the code, so please move that line here:
Code: Select all
HB_FUNC(BMP_PAINT)
{
HWND hWnd;
HBITMAP hBitmap;
HDC memDC, hDC;
RECT rect;
RECT aSource;
BITMAP bm;
int nMode;
PAINTSTRUCT ps;
...
so i wonder that it run under harbour / HMG
