Jump to content
Sign in to follow this  

refresh windows task bar

Recommended Posts



I am drawing on the windows task bar with GDI. The Problem: I cant remove what I have drawn, because I cant get the taskbar to refresh.

Every other window can receive a WM_Paint Message. Not so the task bar (and the desktop btw)

What to do here?

#include <WinAPI.au3>
#include <SendMessage.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>


$hDC      = _WinAPI_GetWindowDC(  0 ) ; DC of entire screen (desktop)
$hGraphic = _GDIPlus_GraphicsCreateFromHDC( $hDC )

_GDIPlus_GraphicsDrawString( $hGraphic, "deleting...", @DesktopWidth - 400 , @DesktopHeight - 18 )


; Remove STRING ????????
$hWnd = WinGetHandle( "classname=Shell_TrayWnd"  )

; 1 Nope...
_SendMessage(  $hWnd , $WM_PAINT , 0 , 0  )

; 2 Nope...
_SendMessage(  $hWnd , $WM_ERASEBKGND , 0 , 0  )

; 3 Nope...
_WinAPI_RedrawWindow( $hWnd )

; 4 Nope...
$paint = DllStructCreate("int;int;long;long;long;long;int;int;byte[32]")
DllCall("user32.dll", "int", "EndPaint", "hwnd", $hWnd  , "ptr", DllStructGetPtr($paint))

; 5 Nope...
WinSetState( $hWnd, '' , @SW_RESTORE)

; 6 Nope...
WinSetState( $hWnd , '' , @SW_SHOW )

Thank you very much



Edited by Bluesmaster

My UDF: [topic='156155']_shellExecuteHidden[/topic]

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.