Page 1 of 1

METRO with visible taskbar ?

Posted: Sat Jun 24, 2017 10:08 am
by ukoenig
Hello,

I would like to show the original windows-taskbar on a METRO-window.
Is that possible ?
I tried with FWH-sample < metro.prg >

Image

with a NORMAL window that works :

Code: Select all

function task_bar_on(ison)

local hwnd 


    hwnd= FindWndByClass("Shell_TrayWnd", "")
    
    If ison 
        ShowWindow(hwnd,5)
    Else
        ShowWindow(hwnd,0)
    End If

return(NIL)

DLL32 Function ShowWindow(hwnd as LONG, nCmdShow as LONG) AS LONG ;
PASCAL FROM "ShowWindow" Lib "user32.dll"
    
DLL32 Function FindWndByClass(wndClass AS LPSTR,WndName as LPSTR) AS LONG ;
PASCAL FROM "FindWindowA" LIB "user32.dll" 
 
regards
Uwe :?:

Re: METRO with visible taskbar ?

Posted: Mon Jun 26, 2017 6:41 am
by Antonio Linares
You may modify the Class TMetro or change the created window style at runtime

Re: METRO with visible taskbar ?

Posted: Sun Jul 02, 2017 8:20 am
by ukoenig
Antonio,

no changes needed, just a window adjustment ( NO window maximized )
If the slider is needed, just 1 line has to be changed

METHOD Paint() CLASS TMetroPanel
oRect:nTop := oRect:nBottom - SCRLB_HEIGHT
adjusted to
oRect:nTop := oRect:nBottom - SCRLB_HEIGHT - 40

The defined mainwindow

DEFINE WINDOW oMWnd TITLE cTitle FROM 0, 0 TO ScreenHeight() + 20, ScreenWidth() PIXEL ;
STYLE nOr( WS_POPUP );
COLOR CLR_WHITE, CLR_GREEN
oMetro := MakeMetroPanel( oMWnd )

DEFINE BRUSH oBrush FILE c_Path1 + "earth.bmp" RESIZE
oMetro:SetBrush( oBrush )
oBrush:End()

oMetro:bRClicked := { |r,c,f,o| msginfo( 'HWND' + NUMTOHEX( oMWnd:hWnd, 8 ) ) }

ACTIVATE WINDOW oMWnd ON INIT oMetro:Show()

Image

regards
Uwe :D

Re: METRO with visible taskbar ?

Posted: Wed Jul 24, 2019 12:49 pm
by MarioG
ukoenig wrote:Antonio,

no changes needed, just a window adjustment ( NO window maximized )
If the slider is needed, just 1 line has to be changed

METHOD Paint() CLASS TMetroPanel
oRect:nTop := oRect:nBottom - SCRLB_HEIGHT
adjusted to
oRect:nTop := oRect:nBottom - SCRLB_HEIGHT - 40

The defined mainwindow

DEFINE WINDOW oMWnd TITLE cTitle FROM 0, 0 TO ScreenHeight() + 20, ScreenWidth() PIXEL ;
STYLE nOr( WS_POPUP );
COLOR CLR_WHITE, CLR_GREEN

oMetro := MakeMetroPanel( oMWnd )

DEFINE BRUSH oBrush FILE c_Path1 + "earth.bmp" RESIZE
oMetro:SetBrush( oBrush )
oBrush:End()

oMetro:bRClicked := { |r,c,f,o| msginfo( 'HWND' + NUMTOHEX( oMWnd:hWnd, 8 ) ) }

ACTIVATE WINDOW oMWnd ON INIT oMetro:Show()

Image

regards
Uwe :D
Hello Uwe
I do it your change: oRect:nTop := oRect:nBottom - SCRLB_HEIGHT - 40
but... look my image
what is the problem?
but... look my image. Not see the Taskbar

Image

Re: METRO with visible taskbar ?

Posted: Wed Jul 24, 2019 6:28 pm
by ukoenig
Mario,
Can You try to adjust the window-height with ScreenHeight() :?:

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( oWnd:nHeight := ScreenHeight() , ; // ( + - )
BUILDMETRO(oWnd) )

regards
Uwe :?:

Re: METRO with visible taskbar ?

Posted: Thu Jul 25, 2019 1:28 am
by MarioG
:oops:
Many Thanks! now is Ok