Solved

Writing to the entire screen in GDI

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

757 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

19 Experts available now in Live!

Get 1:1 Help Now