Click here to Skip to main content
15,913,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to Launch IE with ShellExecute? Pin
Ivan Cachicatari27-Jul-04 15:30
Ivan Cachicatari27-Jul-04 15:30 
AnswerRe: how to Launch IE with ShellExecute? Pin
Ryan Binns27-Jul-04 18:39
Ryan Binns27-Jul-04 18:39 
AnswerRe: how to Launch IE with ShellExecute? Pin
Archer28227-Jul-04 19:26
Archer28227-Jul-04 19:26 
GeneralRe: how to Launch IE with ShellExecute? Pin
Dody_DK28-Jul-04 0:30
Dody_DK28-Jul-04 0:30 
GeneralRe: how to Launch IE with ShellExecute? Pin
Ravi Bhavnani28-Jul-04 13:54
professionalRavi Bhavnani28-Jul-04 13:54 
QuestionHow to change combo styles in runtime Pin
Ivan Cachicatari27-Jul-04 10:57
Ivan Cachicatari27-Jul-04 10:57 
AnswerRe: How to change combo styles in runtime Pin
David Crow28-Jul-04 4:00
David Crow28-Jul-04 4:00 
GeneralA couple of questions... Pin
0v3rloader27-Jul-04 10:07
0v3rloader27-Jul-04 10:07 
Hi there,

I posted previously about GDI objects and how I should be dealing with them. Well someone said something (which I have implemented thereafter) about deselecting the objects used in a DC "session". In order to understand what I mean by DC session, we'll have to consider the following:

void CClass::MyPaintProc(...)
{
	CDC *pDC;

	pDC = new CDC;
	pDC -> Attach(GetDC() -> GetSafeHdc());

	pOldPen = pDC -> SelectObject(myPen);
	pOldBrush = pDC -> SelectObject(myBrush);
	.
	:
	.
	pDC -> SelectObject(pOldPen);	// does one need to do this?
	pDC -> SelectObject(pOldBrush);	// 
	ReleaseDC(pDC);
	delete pDC;
}


What is the purpose of de-selecting the GDI objects? I really would like to know the reason behind it...

Now as for the second question. Is there any way of making the main thread (the app) receive and translate the keyboard accelerators which activate the menus regardless of the window that has the focus? I've tried using TranslateAccelerator but couldn't solve it.

And the third and final question... hope you're not bored just as yet Smile | :) . How can I get a CRegion (or something similar that Windows understands) of the visible area of the client area of a window? Imagine a dialog box hovering partially over a control. How can I know the visible area of the control?

For just being brave enough to take the time to read through all this, I thank you.

David
GeneralRe: A couple of questions... Pin
Ryan Binns27-Jul-04 18:49
Ryan Binns27-Jul-04 18:49 
GeneralRe: A couple of questions... Pin
0v3rloader28-Jul-04 0:50
0v3rloader28-Jul-04 0:50 
GeneralRe: A couple of questions... Pin
Tomasz Sowinski28-Jul-04 1:00
Tomasz Sowinski28-Jul-04 1:00 
Questionhow make make an image with system colors? Pin
Kamis27-Jul-04 8:37
Kamis27-Jul-04 8:37 
AnswerRe: how make make an image with system colors? Pin
Ryan Binns27-Jul-04 19:07
Ryan Binns27-Jul-04 19:07 
GeneralRe: how make make an image with system colors? Pin
Kamis27-Jul-04 23:18
Kamis27-Jul-04 23:18 
QuestionHow do I create a "floating" dialog box? Pin
shihuik27-Jul-04 6:33
shihuik27-Jul-04 6:33 
AnswerRe: How do I create a "floating" dialog box? Pin
David Crow27-Jul-04 7:55
David Crow27-Jul-04 7:55 
GeneralIDE Bug/Problem Pin
sweep12327-Jul-04 6:14
sweep12327-Jul-04 6:14 
GeneralRe: IDE Bug/Problem Pin
David Crow27-Jul-04 8:09
David Crow27-Jul-04 8:09 
GeneralRe: IDE Bug/Problem Pin
sweep12327-Jul-04 22:02
sweep12327-Jul-04 22:02 
GeneralRe: IDE Bug/Problem Pin
David Crow28-Jul-04 3:58
David Crow28-Jul-04 3:58 
GeneralRe: IDE Bug/Problem Pin
sweep12328-Jul-04 6:29
sweep12328-Jul-04 6:29 
Generalcpu performance Pin
hph27-Jul-04 4:59
hph27-Jul-04 4:59 
GeneralRe: cpu performance Pin
David Crow27-Jul-04 8:05
David Crow27-Jul-04 8:05 
GeneralRe: cpu performance Pin
bikram singh27-Jul-04 8:06
bikram singh27-Jul-04 8:06 
GeneralNT: Use Performance Counters Pin
bikram singh27-Jul-04 8:09
bikram singh27-Jul-04 8:09 

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.