Page 2 of 3
Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 5:39 am
by AUGE_OHR
hi,
the Code "just" disable visual Style of Control with GetControlHandle(), not hole App or OS
so when have 10 Button you have to use it 10 x times while default all Controls, using Manifest, have visual Style.
---
under Xbase++ we have Property "UseVisualStyle" for each Control.
when set to .F. it just do Code which i have shown
Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 5:48 am
by andyglezl
Tienes algún ejemplo que nos pudieras compartir para poderlo probar ?
*---------------------------------------------------------------------------------------
Do you have an example that you could share with us to try it out?
Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 6:22 am
by mol
AUGE_OHR wrote: ↑Tue Mar 31, 2020 4:41 am
hi
andyglezl wrote: ↑Mon Mar 30, 2020 8:58 pm
In BUTTONS you cannot change the colors ...
this is true when have visual Style on (default)
you can disable Visual Style with
Code: Select all
hwnd:= GetControlHandle( "Button_1", cForm)
SetWindowTheme( hwnd, 0, 0 )
now you can use Color for Button
I've tried, not working...
Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 6:50 am
by AUGE_OHR
hi,
mol wrote: ↑Tue Mar 31, 2020 6:22 am
I've tried, not working...
it "just" disable visual Style so how do you "Paint" Color

Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 7:52 am
by AUGE_OHR
hi,
it work that Way with Label as it have BACKCOLOR but using "CREATE EVENT" seem me "limited"
we have
Code: Select all
ON LOSTFOCUS -> WM_KILLFOCUS
ON GOTFOCUS -> WM_SETFOCUS
but it is not the same like
Code: Select all
WM_MOUSELEAVE
WM_MOUSEMOVE
WM_MOUSEHOVER
those Windows Message are not used in h_windows.prg of HMG LIB.
when next Release of HMG include the Event and we must not work with a Workaround.
next Step would be to include WM_MEASUREITEM and WM_DRAWITEM with MEASUREITEM- and DRAWITEM-Structure and a "DrawItem" Codeblock Slot so User can "paint" what he want.
this is a Xbase++ Sample ( have no HMG Sample yet)

- Hot_Button.gif (116.5 KiB) Viewed 4375 times
p.s. also WS_EX_ACCEPTFILES -> "DropZone" for each Control would be fine so we need no DragAcceptFiles()
Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 8:34 am
by gfilatov
AUGE_OHR wrote: ↑Tue Mar 31, 2020 7:52 am
...
this is a Xbase++ Sample ( have no HMG Sample yet)
Hi,
Please be so kind to review the following Minigui sample also:

- mousehover.png (95.96 KiB) Viewed 4370 times
The source code is attached here (along with the compiled application)

HTH

Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 9:02 am
by AUGE_OHR
hi,
YES, MiniGUI use much more Events than HMG
i´m still a harbour Newbie and have made my 1st Step with HMG.
now i can "walk" with HMG but to "run" with MiniGUI i still need time.

Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 9:08 am
by mol
AUGE_OHR wrote: ↑Tue Mar 31, 2020 6:50 am
hi,
mol wrote: ↑Tue Mar 31, 2020 6:22 am
I've tried, not working...
it "just" disable visual Style so how do you "Paint" Color
I'm trying for one button in this way:
SetWindowTheme( OknoPartieProd.P_RozliczeniePartii.Handle, 0, 0 )
SetProperty("OknoPartieProd","P_RozliczeniePartii","FontColor", {255,0,0}) // colorize to red
Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 10:42 am
by AUGE_OHR
hi,
mol wrote: ↑Tue Mar 31, 2020 9:08 am
SetProperty("OknoPartieProd","P_RozliczeniePartii","FontColor", {255,0,0}) // colorize to red
we talk about Button
i don´t "see" in Help that Button have any Color Option so i ask for it.
---
HMG Syntax only work if API is behind.
under Xbase++ i use DLLCALL under harbour HB_FUNC()
this Sample i use to "paint" Darkmode (some Control have no Color Option)
Code: Select all
SetWindowTheme( OknoPartieProd.P_RozliczeniePartii.Handle, 0, 0 )
CONTROLBACKGROUND( OknoPartieProd.P_RozliczeniePartii.Handle, {255,0,0} )
HB_FUNC(CONTROLBACKGROUND)
{
HWND hWnd;
HDC hDC;
RECT rect;
HBRUSH hbrush;
PAINTSTRUCT ps;
hWnd = (HWND) hb_parnl (1);
GetClientRect(hWnd, &rect);
hbrush = CreateSolidBrush( (COLORREF) RGB(hb_parvni(2, 1),
hb_parvni(2, 2),
hb_parvni(2, 3)) );
hDC = BeginPaint (hWnd, &ps);
FillRect(hDC,&rect,(HBRUSH) hbrush );
ReleaseDC(hWnd, hDC);
}
Re: FUNCTION OnMouseHover( hWnd, cFormName )
Posted: Tue Mar 31, 2020 11:58 pm
by jairpinho
gfilatov wrote: ↑Tue Mar 31, 2020 8:34 am
AUGE_OHR wrote: ↑Tue Mar 31, 2020 7:52 am
...
this is a Xbase++ Sample ( have no HMG Sample yet)
Hi,
Please be so kind to review the following Minigui sample also:
mousehover.png
The source code is attached here (along with the compiled application)

HTH
helo this is perfect!! but how to make it work in hmg without using buttonex? would have how to create a buttonex function in hmg to use