-
February 17th, 2010, 06:21 AM
#1
Write Text On Desktop Background (in Windows OS)
Hi,
I want to write text on the desktop background that updates itself every X seconds.
Can someone show me simple sample C/C++ code how to write for example text "Hello" on desktop background.
Best regards
-
February 17th, 2010, 08:27 AM
#2
Re: Write Text On Desktop Background (in Windows OS)
I don't see this being any harder than writing text on a window. But instead of using a clientDC, you would use the screenDC. Look up device contexts on windows.
-
February 17th, 2010, 10:14 AM
#3
Re: Write Text On Desktop Background (in Windows OS)
Any piece of code i.e. example using screenDC for this purpose?
What I need is possibility to change text font and that text written on desktop stays even if we move other windows, mouse etc over screen.
This is what I try but this way I can not play with text font and text disappear after moving other windows, mouse... over screen:
--------------------------------------------------------------------------------------------------------------------------------------------------------
int DrawOnSC(char szBuffer[], int bottom, int left, int right, int top, RECT& rect, HDC& hdc, HWND& hwnd, int& iLength) {
SetRect(&rect, bottom, left, right + 34, top + 34);
DrawText(hdc, szBuffer, iLength, &rect, 32);
return 0;
}
int main()
{
RECT rect;
TCHAR szBuffer[50] = {0}; // Text to be outputted
HWND hWnd = GetActiveWindow();
HDC hdc = ::GetWindowDC(NULL);
int iLength = 0;
iLength = wsprintf(szBuffer, "Hello World!");
DrawOnSC(szBuffer, 50, 50, 150, 50, rect, hdc, hWnd, iLength); //function call
return 0;
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
Anny suggestions how to be abble to change text font and that text stays over other windows i.e. always in front of screen?
Thanks in advance
Last edited by melinda123; February 18th, 2010 at 04:17 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|