Archived

This topic is now archived and is closed to further replies.

miko

i need to draw on tv screen (win32 api)....

Recommended Posts

i need to create an application where user selects (on primary display device) items to draw on tv screen (under win32). i used EnumDisplayDevices to search for a device without DISPLAY_DEVICE_ATTACHED_TO_DESKTOP flag (this will be my tv screen). this seems working. but i don't know how to create a dc. msdn says i should use CreateDC(device_name, NULL, NULL, devmode). how should i set devmode parameter? because it always fails please, any suggestion or example or something... help me and i will love you forever [edited by - miko on July 26, 2003 9:12:58 PM]

Share this post


Link to post
Share on other sites
in an attempt to recieve your eternal love, i might be able
to answer your post, but as usual i have sources that might
answer it better than i could ever do, check out this website

http://www.gametutorials.com/Tutorials/Win32/Win32_Pg1.htm

im not sure whether they have what exactly your looking for
but it might be of help ;]

Share this post


Link to post
Share on other sites
this is not what i want. i want to create DC but i don''t have a window so GetDC will not help. i''m trying to get DC of off-desktop monitor and this is a problem...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There''s some kind of function like GetDesktopHandle() which returns the hdc of the desktop. I''m not exactly sure of the name but it''s something like that. check msdn.

Share this post


Link to post
Share on other sites
i think you mean hdc = GetDC(GetDesktopWindow()) but i''m NOT DRAWING TO DESKTOP but to independent tv screen.

again: only solution i see is to use CreateDC (not GetDC because i don''t have hwnd - window manager don''t know about independent displays) but lovely CreateDC always fails. GetLastError says somethink like `Invalid printer name'' (i don''t have english windows so i can only guess english message)

Share this post


Link to post
Share on other sites
Use EnumDisplayDevices() to find the correct display name for your secondary output, then put that into the CreateDC() call :

CreateDC(deviceName,deviceName,NULL,NULL);

THe error message you are receiving means that Windows thinks that you are trying to create a DC for a printer not a display device - make sure you have the correct device name from EnumDisplayDevices().

Share this post


Link to post
Share on other sites