Click here to Skip to main content
15,910,277 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: writing an application that runs only as administrator Pin
Anonymous29-Jul-04 17:33
Anonymous29-Jul-04 17:33 
GeneralGet item selection notification on a CListCtrl Pin
Gizmo7929-Jul-04 0:26
Gizmo7929-Jul-04 0:26 
GeneralRe: Get item selection notification on a CListCtrl Pin
David Crow29-Jul-04 3:16
David Crow29-Jul-04 3:16 
GeneralRe: Get item selection notification on a CListCtrl Pin
Gizmo7929-Jul-04 4:23
Gizmo7929-Jul-04 4:23 
GeneralHide some portion of Dialog Pin
Anonymous29-Jul-04 0:25
Anonymous29-Jul-04 0:25 
GeneralRe: Hide some portion of Dialog Pin
V.29-Jul-04 1:30
professionalV.29-Jul-04 1:30 
GeneralRe: Hide some portion of Dialog Pin
Anonymous29-Jul-04 1:45
Anonymous29-Jul-04 1:45 
GeneralRe: Hide some portion of Dialog Pin
V.29-Jul-04 2:02
professionalV.29-Jul-04 2:02 
I did once a trick by setting a groupbox around the controls.
This groupbox' rectangle is exactly the rectangle to hide. You can then redraw your video window.

how to hide your menu I don't know.
here's some sample code I've used.
	//get the right points & distances to redraw the grid.<br />
	CRect filterrect;				//rectangle of filter group<br />
	CRect flexlistrect;				//rectangle of list<br />
	CRect hsbtnrect;				//rectangle of hide show button<br />
	CWnd* pWnd;<br />
	pWnd = (CWnd*)GetDlgItem(IDC_STATIC3);<br />
	pWnd->GetClientRect(filterrect);<br />
	m_lstActivations.GetClientRect(flexlistrect);<br />
	m_btnhideshow.GetClientRect(hsbtnrect);<br />
<br />
	topoflisthidden = hsbtnrect.bottom + 15;<br />
	topoflistshown = filterrect.bottom + hsbtnrect.bottom + 15;<br />
	bottomoflisthidden = flexlistrect.bottom + filterrect.bottom + hsbtnrect.bottom - 5;<br />
	bottomoflistshown = bottomoflisthidden - (filterrect.bottom);<br />
	widthoflist = filterrect.right;



<br />
	if(showed == false){<br />
		sortcol = 2;				//sort on patients<br />
		//hide all filter controls<br />
		CWnd *pWnd;<br />
		pWnd = (CWnd*)GetDlgItem(IDC_COMBO_COLUMN);<br />
		pWnd->ShowWindow(SW_HIDE);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_EDIT_COLUMNVALUE);<br />
		pWnd->ShowWindow(SW_HIDE);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_STATIC2);<br />
		pWnd->ShowWindow(SW_HIDE);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_STATIC_SORT);<br />
		pWnd->ShowWindow(SW_HIDE);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_STATIC_VALUE);<br />
		pWnd->ShowWindow(SW_HIDE);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_COMBO_SORTCOLUMNS);<br />
		pWnd->ShowWindow(SW_HIDE);<br />
<br />
		//clear the filter<br />
		m_lstActivations.Clear();<br />
		//clear the edit box<br />
		m_editcolumnvalue.SetWindowText("");<br />
		//set the column combobox to first column<br />
		m_combocolumn.SetCurSel(0);<br />
<br />
		//write sessionsettings to NULL<br />
		sessionsettings->filtercol_inpat = 0;<br />
		sessionsettings->filtervalue_inpat = "";<br />
		sessionsettings->selectedrow_inpat = 1;<br />
		sessionsettings->sortcol_inpat = 0;		<br />
		sessionsettings->showed_inpat = showed;<br />
<br />
		//set new button icon<br />
		HICON icon;<br />
		icon = (HICON)::LoadImage(AfxGetResourceHandle(),  MAKEINTRESOURCE(IDI_ICON_SHOW), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
		m_btnhideshow.SetIcon(icon);<br />
<br />
		//Resize grid<br />
		//-1 & -3 -> small corrections to make it nice and pretty<br />
		m_lstActivations.MoveWindow(0 + 15 - 3, topoflisthidden, widthoflist-1, bottomoflisthidden);<br />
		showed = true;<br />
	}								//end if<br />
	else{<br />
		if(m_combosort.GetCurSel() != -1){<br />
			sortcol = m_combosort.GetCurSel() + 2;		//sort on<br />
		}								//end if<br />
		//Resize grid<br />
		//-1 & -3 -> small corrections to make it nice and pretty<br />
		m_lstActivations.MoveWindow(0 + 15 - 3, topoflistshown, widthoflist-1, bottomoflistshown);<br />
		//show all filter controls<br />
		CWnd *pWnd;<br />
		pWnd = (CWnd*)GetDlgItem(IDC_COMBO_COLUMN);<br />
		pWnd->ShowWindow(SW_SHOW);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_EDIT_COLUMNVALUE);<br />
		pWnd->ShowWindow(SW_SHOW);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_STATIC2);<br />
		pWnd->ShowWindow(SW_SHOW);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_STATIC_SORT);<br />
		pWnd->ShowWindow(SW_SHOW);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_STATIC_VALUE);<br />
		pWnd->ShowWindow(SW_SHOW);<br />
		pWnd = (CWnd*)GetDlgItem(IDC_COMBO_SORTCOLUMNS);<br />
		pWnd->ShowWindow(SW_SHOW);<br />
<br />
		//set new button icon<br />
		HICON icon;<br />
		icon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_HIDE), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
		m_btnhideshow.SetIcon(icon);<br />
<br />
		sessionsettings->showed_inpat = showed;<br />
		m_editcolumnvalue.SetFocus();<br />
		showed = false;<br />
	}								//end else<br />
	m_btnhideshow.SetButtonStyle(BS_PUSHLIKE|WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_ICON|BS_TOP|BS_LEFT);<br />
	m_PrintList.SetButtonStyle(BS_PUSHLIKE|WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_ICON|BS_TOP|BS_LEFT);<br />
	//set print button icon.<br />
	HICON printicon;<br />
	printicon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_PRINT), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
	m_PrintList.SetIcon(printicon);<br />
<br />
	CRect rect, rect1, rect2, rect3;<br />
	CWnd* pWnd;<br />
	pWnd = (CWnd*)GetDlgItem(IDC_LIST_ACTIVATIONS);<br />
	pWnd->GetClientRect(rect1);<br />
	rect3.bottom = 16 + 5;<br />
	rect3.top = 5;<br />
	rect3.right = rect1.right;<br />
	rect3.left = rect1.right - 16;<br />
	m_PrintList.MoveWindow(rect3, TRUE);<br />
	m_PrintList.GetClientRect(rect2);<br />
	rect.bottom = 16 + 5; <br />
	rect.top = 5;<br />
	rect.right = rect1.right - rect2.right - 5;<br />
	rect.left = rect1.right - rect2.right - 5 - 16;<br />
	m_btnhideshow.MoveWindow(rect, TRUE);<br />
	UpdateWindow();<br />
	if(initializing == false){<br />
		OnRefresh();<br />
	}								//end if<br />
<br />


good luck.

"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
GeneralSocket Multithreading Pin
asv29-Jul-04 0:11
asv29-Jul-04 0:11 
GeneralRe: Socket Multithreading Pin
SOCM_FP_CPP29-Jul-04 2:07
SOCM_FP_CPP29-Jul-04 2:07 
GeneralRe: Socket Multithreading Pin
asv29-Jul-04 2:31
asv29-Jul-04 2:31 
GeneralRe: Socket Multithreading Pin
asv29-Jul-04 2:41
asv29-Jul-04 2:41 
GeneralSMB Share and file access Pin
Jan7529-Jul-04 0:01
Jan7529-Jul-04 0:01 
GeneralRe: SMB Share and file access Pin
Antony M Kancidrowski29-Jul-04 2:28
Antony M Kancidrowski29-Jul-04 2:28 
GeneralPrinter Port Pin
Anonymous28-Jul-04 23:44
Anonymous28-Jul-04 23:44 
Generalapplication runs as an administrator, fails when logged on as any other user Pin
Anonymous28-Jul-04 23:30
Anonymous28-Jul-04 23:30 
Generalchange icon when pass over a zone in a Picture control Pin
doctorpi28-Jul-04 22:21
doctorpi28-Jul-04 22:21 
GeneralRe: change icon when pass over a zone in a Picture control Pin
GDavy29-Jul-04 0:03
GDavy29-Jul-04 0:03 
GeneralRe: change icon when pass over a zone in a Picture control Pin
doctorpi29-Jul-04 0:13
doctorpi29-Jul-04 0:13 
GeneralRe: change icon when pass over a zone in a Picture control Pin
GDavy29-Jul-04 0:18
GDavy29-Jul-04 0:18 
GeneralRe: change icon when pass over a zone in a Picture control Pin
doctorpi29-Jul-04 0:20
doctorpi29-Jul-04 0:20 
GeneralRe: change icon when pass over a zone in a Picture control Pin
GDavy29-Jul-04 0:39
GDavy29-Jul-04 0:39 
GeneralShare functionality Pin
JensB28-Jul-04 22:15
JensB28-Jul-04 22:15 
GeneralRe: Share functionality Pin
Antony M Kancidrowski29-Jul-04 2:31
Antony M Kancidrowski29-Jul-04 2:31 
GeneralRe: Share functionality Pin
JensB29-Jul-04 3:48
JensB29-Jul-04 3:48 

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.