?
Solved

Writing to the entire screen in GDI

Posted on 2001-08-05
4
Medium Priority
?
324 Views
Last Modified: 2012-05-04
I use the windows GDI routines (GetDC(), ...) to put grafix in a my program's window.
However, I want to write to the entire screen (full screen mode, where the only the content of the window is showing, no status bar and no window borders etc.)

I tried using GetDCEx(NULL, NULL, DCX_WINDOW) but it returns me NULL and GetLastError() returns 0.

How do I switch to full screen mode?
0
Comment
Question by:mathought
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 400 total points
ID: 6353549
Try using GetDC(NULL) instead.  That always works form me.

>> How do I switch to full screen mode?
There is no such thing.
0
 
LVL 22

Expert Comment

by:nietod
ID: 6353568
Usually if you want to draw to the full screen, you must size your window to the dimensions of the full screen.  You can do this with

int ScnWdt = GetSystemMetrics(SM_CXSCREEN);
int ScnHgt = GetSystemMetrics(SM_CYSCREEN);

MoveWindow(WindowHandle,0,0ScnWdt,ScnHgt,true);

This will move your window to fill the screen.  If you usually have borders on your window and don't want them to show when taking up the whole screen, you either need to handle WM_NCCALCSIZE to rmeove the borders when using the full screen, so your client area fills the entire window, which in turn fills the entire screen.  Or you can use AdjustWindowRect() to figure out what size window rectangle you need in order to produce a client area that fills the screen.

You also might consider wha tyou want to do when the users has multiple monitors....
0
 

Author Comment

by:mathought
ID: 6354857
Thanks!
I should have guessed that.
Why isn't it documented?...
0
 
LVL 22

Expert Comment

by:nietod
ID: 6355322
Why isn't what documented?   I don't know of anything in that answer that is not documented.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question