Sign in to follow this  
Followers 0
Xander

Progress just above taskbar

6 posts in this topic

#1 ·  Posted (edited)

I'm revising one of my scripts to use a progress bar, which I want positioned just above the taskbar. Only problem is that some taskbars hide ... and when they pop back up, they are showing over the progress bar. Sure, I could make a guess at an average height of a taskbar (1-2 lines) and just compensate for that, but I'd like to see if it can be done.

i.e.: $Y = @DesktopHeight - $taskbarheight - $ProgressBarHeight

Edited by Xander

Share this post


Link to post
Share on other sites



$Y = String(@DesktopHeight - $taskbarheight - $ProgressBarHeight)


-jaenster

Share this post


Link to post
Share on other sites

The real question is: How do you determine the height of the taskbar when it's showing?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$a_taskbar = _GetTaskBarPos()
If IsArray($a_taskbar) Then
    ConsoleWrite("Left  : " & $a_taskbar[1] & @LF)
    ConsoleWrite("Top   : " & $a_taskbar[2] & @LF)
    ConsoleWrite("Right : " & $a_taskbar[3] & @LF)
    ConsoleWrite("Bottom: " & $a_taskbar[4] & @LF)
EndIf

Func _GetTaskBarPos()
    Global Const $ABM_GETTASKBARPOS = 0x5
    $h_taskbar = WinGetHandle("","Start")
    $AppBarData = DllStructCreate("dword;int;uint;uint;int;int;int;int;int")
;~ DWORD cbSize;
;~   HWND hWnd;
;~   UINT uCallbackMessage;
;~   UINT uEdge;
;~   RECT rc;
;~   LPARAM lParam;
    DllStructSetData($AppBarData,1,DllStructGetSize($AppBarData))
    DllStructSetData($AppBarData,2,$h_taskbar)
    $lResult = DllCall("shell32.dll","int","SHAppBarMessage","int",$ABM_GETTASKBARPOS,"ptr",DllStructGetPtr($AppBarData))
    If Not @error Then
        If $lResult[0] Then
            Return StringSplit(DllStructGetData($AppBarData,5) & "|" & _
                DllStructGetData($AppBarData,6) & "|"   & DllStructGetData($AppBarData,7) & "|" & _
                DllStructGetData($AppBarData,8),"|")
        EndIf
    EndIf
    SetError(1)
    Return 0
EndFunc

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I'm revising one of my scripts to use a progress bar, which I want positioned just above the taskbar.

Are you sure you want to assume the user has the taskbar at the bottom of the screen? It could be a the top or left or right; or the person might not even use the explorer shell.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Think that would depend on the x,y,width,height

Might be a function that says location of bar, not sure on that

Global Const $ABS_ALWAYSONTOP = 0x2
Global Const $ABS_AUTOHIDE = 0x1
$result = _GetTaskBarState()
If BitAND($result,$ABS_ALWAYSONTOP) = $ABS_ALWAYSONTOP Then ConsoleWrite("ALWAYSONTOP" & @LF)
If BitAND($result,$ABS_AUTOHIDE) = $ABS_AUTOHIDE Then ConsoleWrite("AUTOHIDE" & @LF)

Func _GetTaskBarState()
    Global Const $ABM_GETSTATE = 0x4
    $h_taskbar = WinGetHandle("","Start")
    $AppBarData = DllStructCreate("dword;int;uint;uint;int;int;int;int;int")
;~ DWORD cbSize;
;~   HWND hWnd;
;~   UINT uCallbackMessage;
;~   UINT uEdge;
;~   RECT rc;
;~   LPARAM lParam;
    DllStructSetData($AppBarData,1,DllStructGetSize($AppBarData))
    DllStructSetData($AppBarData,2,$h_taskbar)
    $lResult = DllCall("shell32.dll","int","SHAppBarMessage","int",$ABM_GETSTATE,"ptr",DllStructGetPtr($AppBarData))
    If Not @error Then
        If $lResult[0] Then Return $lResult[0]
    EndIf
    SetError(1)
    Return 0
EndFunc
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0