Jump to content

refresh windows task bar


Recommended Posts

Hi,

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>


_GDIPlus_Startup()
Sleep(150)

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

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

_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()


; Remove STRING ????????
Opt('WINTITLEMATCHMODE', 4)
$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

regards

Bluesmaster

Edited by Bluesmaster

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...