Click here to Skip to main content
15,886,664 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Quantum Computing sim ? Pin
David Crow8-Nov-17 3:43
David Crow8-Nov-17 3:43 
AnswerRe: Quantum Computing sim ? Pin
bluatigro13-Nov-17 22:07
bluatigro13-Nov-17 22:07 
QuestionMessage Closed Pin
7-Nov-17 0:09
Munchies_Matt7-Nov-17 0:09 
AnswerRe: Anyone noticed that... Pin
Richard MacCutchan7-Nov-17 0:28
mveRichard MacCutchan7-Nov-17 0:28 
PraiseRe: Anyone noticed that... Pin
CPallini7-Nov-17 0:37
mveCPallini7-Nov-17 0:37 
GeneralRe: Anyone noticed that... Pin
Richard MacCutchan7-Nov-17 1:10
mveRichard MacCutchan7-Nov-17 1:10 
GeneralRe: Anyone noticed that... Pin
CPallini7-Nov-17 2:55
mveCPallini7-Nov-17 2:55 
Questioncreate a dpi-aware application Pin
Theo Buys6-Nov-17 23:19
Theo Buys6-Nov-17 23:19 
I try to find out what the best strategy is to create a MFC based application that is dpi-aware. Windows is based on 96 dpi for years. Today there are pc's like the Microsoft Surface that have lot more dots per inch.

In windows you can set the screen scaling factor to 100%, 125%, 150%, etc.

If you build the application with a manifest that set DPI Awareness with High DPI Aware, then the resource templates like dialogs scale automatically. Only the custom drawings must be scaled with extra code
like:
C++
int DpiScale(int val)
{
   const HDC hDC = ::GetDC(NULL);
   const UINT dpix = ::GetDeviceCaps(hDC, LOGPIXELSX);
   ::ReleaseDC(NULL, hDC);
   return ::MulDiv(val, dpix, 96);
}

int DpiPerc()
{
   return DpiScale(100);
}

DpiScale you can for coordinates or font points. DpiPerc you can use to select the a icon or picturewith the right resolution from resource.

My question is, must I develop the application for 1024 x 768?
AnswerRe: create a dpi-aware application Pin
Richard MacCutchan7-Nov-17 0:24
mveRichard MacCutchan7-Nov-17 0:24 
GeneralRe: create a dpi-aware application Pin
Theo Buys7-Nov-17 0:54
Theo Buys7-Nov-17 0:54 
GeneralRe: create a dpi-aware application Pin
Richard MacCutchan7-Nov-17 1:09
mveRichard MacCutchan7-Nov-17 1:09 
GeneralRe: create a dpi-aware application Pin
Theo Buys7-Nov-17 1:37
Theo Buys7-Nov-17 1:37 
GeneralRe: create a dpi-aware application Pin
Richard MacCutchan7-Nov-17 1:50
mveRichard MacCutchan7-Nov-17 1:50 
GeneralRe: create a dpi-aware application Pin
Theo Buys7-Nov-17 2:09
Theo Buys7-Nov-17 2:09 
GeneralRe: create a dpi-aware application Pin
Richard MacCutchan7-Nov-17 3:27
mveRichard MacCutchan7-Nov-17 3:27 
AnswerRe: create a dpi-aware application Pin
Gisle Vanem7-Nov-17 19:35
Gisle Vanem7-Nov-17 19:35 
GeneralRe: create a dpi-aware application Pin
Theo Buys17-Dec-18 22:36
Theo Buys17-Dec-18 22:36 
QuestionCan we define the Right control key as an ACCELERATOR in the resource file ? Pin
Maximilien3-Nov-17 10:12
Maximilien3-Nov-17 10:12 
AnswerRe: Can we define the Right control key as an ACCELERATOR in the resource file ? Pin
Richard MacCutchan5-Nov-17 2:09
mveRichard MacCutchan5-Nov-17 2:09 
GeneralRe: Can we define the Right control key as an ACCELERATOR in the resource file ? Pin
Maximilien7-Nov-17 5:48
Maximilien7-Nov-17 5:48 
QuestionFind maximun range of an array Pin
Member 135010212-Nov-17 22:35
Member 135010212-Nov-17 22:35 
QuestionRe: Find maximun range of an array Pin
David Crow3-Nov-17 3:51
David Crow3-Nov-17 3:51 
SuggestionRe: Find maximun range of an array Pin
Sascha Lefèvre3-Nov-17 4:22
professionalSascha Lefèvre3-Nov-17 4:22 
AnswerRe: Find maximun range of an array Pin
Sascha Lefèvre3-Nov-17 14:17
professionalSascha Lefèvre3-Nov-17 14:17 
QuestionCalculate sum of M natural numbers starting from N. Pin
Member 134789861-Nov-17 9:16
Member 134789861-Nov-17 9:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.