Solved

Writing to the entire screen in GDI

Posted on 2001-08-05
4
316 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

816 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now