Author: Tomas Rutkauskas
Does anyone know how to write a text on the main taskbar in Win95 using Delphi 3.0?
Answer:
This modified splash procedure that I use draws text directly on the Start button.
Perhaps it helps. I normally use it to draw splash text directly on screen. To do
that, use DC:= GetDC(0):
1 procedure TForm1.Button1Click(Sender: TObject);
2 var
3 DC: hDC;
4 Size: TSize;
5 Font: hFont;
6 const
7 DispText = 'Test';
8 begin
9 DC := GetDC(GetDlgItem(FindWindow(PChar('Shell_TrayWnd'), nil), $130));
10 ShowMessage(IntToStr(GetDlgItem(FindWindow(PChar('Shell_TrayWnd'), nil), $130)));
11 SetBkMode(DC, TRANSPARENT);
12 Font := CreateFont(12, 10, 0, 0, 1000, 0, 0, 0, ANSI_CHARSET, OUT_DEVICE_PRECIS,
13 CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH, 'ARIAL');
14 SelectObject(DC, Font);
15 SetTextColor(DC, RGB(128, 128, 0));
16 GetTextExtentPoint(DC, PChar(DispText), Length(DispText), Size);
17 TextOut(DC, 0, 0, PChar(DispText), Length(DispText));
18 DeleteObject(Font);
19 ReleaseDC(GetDlgItem(FindWindow(PChar('Shell_TrayWnd'), nil), $130), DC);
20 end;
|