Hi,
I have an application, that is drawing a simple text on my desktop.
I have two button created on desktop, and when i click one of them the text is displayed. It should be displayed all the time, but when I put something on it (for example if I move an icon into the text area), , the text dissapears.
I'm using global hook to see if the button is pressed.
My painting code :
Delphi Code:
//if hook catch an WM_PAINT message it sends a message to application // application code when the WM_PAINT message is found:
DC := BeginPaint(GetDesktopListViewHandle, PS);
SetBkMode(DC, TRANSPARENT);
SetTextColor(DC, RGB(0, 0, 0));
TextOut(DC, 1024 - 200, i, Pchar(s), Length(s));
EndPaint(GetDesktopListViewHandle, PS);
and the GetDesktopListViewHandle function looks :
Delphi Code:
function GetDesktopListViewHandle: THandle;
var
S: String;
begin
Result := FindWindow('ProgMan', nil);
Result := GetWindow(Result, GW_CHILD);
Result := GetWindow(Result, GW_CHILD);
SetLength(S, 40);
GetClassName(Result, PChar(S), 39);
if PChar(S) <> 'SysListView32' then
Result := 0;
end;
I must redraw the text, when something is put on it, but i don't know after what message should I redraw it, and how ?
Please help.