Skip to content

Instantly share code, notes, and snippets.

@snaka
Created October 17, 2010 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snaka/630543 to your computer and use it in GitHub Desktop.
Save snaka/630543 to your computer and use it in GitHub Desktop.
デスクトップに文字を描画する(不完全版)
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrev,
PSTR cmdLine, int cmdShow)
{
HWND desktop = GetDesktopWindow();
HDC hdc = GetWindowDC(desktop);
TCHAR label[] = TEXT("hoge");
TextOut(hdc, 100, 100, label, lstrlen(label));
UpdateWindow(desktop);
}
@snaka
Copy link
Author

snaka commented Oct 17, 2010

この方法だと、スクリーンの前面のレイヤー(?)に描画されてしまいます。
また、他のウィンドウが重なったとき再描画されません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment