CreateEllipticRgn / CreateRectRgn

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

edk
Posts: 911
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: CreateEllipticRgn / CreateRectRgn

Post by edk »

AUGE_OHR wrote: Wed Nov 27, 2019 4:53 am
other are Syntax with "."

Code: Select all

   BMP_BAND1.Label_1.value := "ABC"   
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) :idea:

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)
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: CreateEllipticRgn / CreateRectRgn

Post 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 :!:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: CreateEllipticRgn / CreateRectRgn

Post by AUGE_OHR »

hi,

i have try Sample with FiveWin and got a Error :o
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 :?:
have fun
Jimmy
Post Reply