Solved

Writing to the entire screen in GDI

Posted on 2001-08-05
4
320 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 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

729 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