Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: IOCTL_STORAGE_EJECTION_CONTROL undeclared identifier Pin
Laxman Auti17-May-06 20:36
Laxman Auti17-May-06 20:36 
AnswerRe: IOCTL_STORAGE_EJECTION_CONTROL undeclared identifier Pin
kakan17-May-06 20:41
professionalkakan17-May-06 20:41 
AnswerRe: IOCTL_STORAGE_EJECTION_CONTROL undeclared identifier Pin
Hamid_RT17-May-06 20:53
Hamid_RT17-May-06 20:53 
GeneralRe: IOCTL_STORAGE_EJECTION_CONTROL undeclared identifier Pin
velayudhan_raj17-May-06 21:03
velayudhan_raj17-May-06 21:03 
GeneralRe: IOCTL_STORAGE_EJECTION_CONTROL undeclared identifier Pin
Hamid_RT17-May-06 21:07
Hamid_RT17-May-06 21:07 
AnswerRe: IOCTL_STORAGE_EJECTION_CONTROL undeclared identifier Pin
Laxman Auti17-May-06 21:08
Laxman Auti17-May-06 21:08 
GeneralRe: IOCTL_STORAGE_EJECTION_CONTROL undeclared identifier Pin
velayudhan_raj17-May-06 21:23
velayudhan_raj17-May-06 21:23 
QuestionHow to draw a border color to static Frame control in C++ Pin
huutribk200117-May-06 20:09
huutribk200117-May-06 20:09 
Hi,
I need draw a border color to static Frame control, 
I have the code as below but it not work with my testing for static Frame and Window Dialog.
Please see the code and help me for this

void CTestDLLDlg::DrawFrameBorder(HWND hWnd,COLORREF refColor)
{
	RECT stRect;

	// Get the coordinates of the window on the screen
	::GetWindowRect(hWnd, &stRect);
	
	// Get a handle to the window's device context
	HDC hDC = ::GetWindowDC(hWnd);

	HPEN hPen;
	hPen = CreatePen(PS_INSIDEFRAME, 2* GetSystemMetrics(SM_CXBORDER), refColor);
	
	// Draw the rectangle around the window
	HPEN   hOldPen   = (HPEN)SelectObject(hDC, hPen);
	HBRUSH hOldBrush = (HBRUSH)SelectObject(hDC, GetStockObject(NULL_BRUSH));
	
	Rectangle(hDC, 0, 0, (stRect.right - stRect.left), (stRect.bottom - stRect.top));

	//Give the window its device context back, and destroy our pen
	::ReleaseDC(hWnd, hDC);

	SelectObject(hDC, hOldPen);
	SelectObject(hDC, hOldBrush);

	DeleteObject(hPen);
	DeleteObject(hDC);
}

At initialize function I called as bellow:

BOOL CTestDLLDlg::OnInitDialog()
{
 CWnd* pWnd = GetDlgItem (IDC_AVATAR1);

 DrawFrameBorder(pWnd->m_hWnd,RGB(255,0,0))//red
 //and for test more: DrawFrameBorder(this->m_hWnd,RGB(255,0,0))//red
 return true;
}
 But it seem to not draw the red border

Please help me
Thank in advance!

AnswerRe: How to draw a border color to static Frame control in C++ Pin
Nishad S17-May-06 21:14
Nishad S17-May-06 21:14 
GeneralRe: How to draw a border color to static Frame control in C++ Pin
Hamid_RT17-May-06 21:18
Hamid_RT17-May-06 21:18 
GeneralRe: How to draw a border color to static Frame control in C++ Pin
Nishad S17-May-06 21:20
Nishad S17-May-06 21:20 
GeneralRe: How to draw a border color to static Frame control in C++ Pin
Hamid_RT17-May-06 21:25
Hamid_RT17-May-06 21:25 
GeneralRe: How to draw a border color to static Frame control in C++ Pin
Nishad S17-May-06 21:28
Nishad S17-May-06 21:28 
AnswerRe: How to draw a border color to static Frame control in C++ Pin
Hamid_RT17-May-06 21:23
Hamid_RT17-May-06 21:23 
AnswerRe: How to draw a border color to static Frame control in C++ Pin
Nishad S17-May-06 22:21
Nishad S17-May-06 22:21 
GeneralRe: How to draw a border color to static Frame control in C++ Pin
huutribk200117-May-06 22:31
huutribk200117-May-06 22:31 
Questionhow to make Applications exe to run in WINNT Pin
code6617-May-06 20:06
code6617-May-06 20:06 
Questionno private no protected oops only public Pin
pathakr17-May-06 20:04
pathakr17-May-06 20:04 
AnswerRe: no private no protected oops only public Pin
_AnsHUMAN_ 17-May-06 20:07
_AnsHUMAN_ 17-May-06 20:07 
AnswerRe: no private no protected oops only public Pin
Sarath C17-May-06 20:13
Sarath C17-May-06 20:13 
AnswerRe: no private no protected oops only public Pin
Laxman Auti17-May-06 20:23
Laxman Auti17-May-06 20:23 
GeneralRe: no private no protected oops only public Pin
ppatel56717-May-06 20:40
ppatel56717-May-06 20:40 
JokeRe: no private no protected oops only public Pin
Laxman Auti17-May-06 20:47
Laxman Auti17-May-06 20:47 
AnswerRe: no private no protected oops only public Pin
ThatsAlok17-May-06 20:38
ThatsAlok17-May-06 20:38 
AnswerRe: no private no protected oops only public Pin
Stephen Hewitt17-May-06 21:05
Stephen Hewitt17-May-06 21:05 

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.