Originally posted by: Gameboy
// If this is not the first call then Delete GDI objects
if( hBmp == NULL )
if( hBmp == NULL)
m_bitmap.Attach( hBmp );
...
return TRUE;
BOOL CPowerTreeCtrl::SetBkImage(LPCTSTR lpszResourceName)
{
if( m_bitmap.m_hObject != NULL )
m_bitmap.DeleteObject();
if( m_pal.m_hObject != NULL )
m_pal.DeleteObject();
HBITMAP hBmp = (HBITMAP)::LoadImage( AfxGetInstanceHandle(),
lpszResourceName, IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION );
{
//added by gameboy...
hBmp = (HBITMAP)::LoadImage( AfxGetInstanceHandle(),
lpszResourceName, IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE);
return FALSE;
}
BITMAP bm;
m_bitmap.GetBitmap( &bm );
m_cxBitmap = bm.bmWidth;
m_cyBitmap = bm.bmHeight;
}
Originally posted by: davidadams
void CMyTreeCtrl::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
if( m_bitmap.m_hObject != NULL )
{
SetRedraw(FALSE);
}
*pResult = 0;
}
void CMyTreeCtrl::OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
if( m_bitmap.m_hObject != NULL )
{
SetRedraw(TRUE);
InvalidateRect(NULL);
}
*pResult = 0;
}
Originally posted by: abscess
THANK YOU SO MUCH! IT WORKED PERFECTLY AND I'D NEARLY GIVEN UP HOPE THAT SUCH A THING COULD EVER BE DONE! THANK YOU, YOU WIN32/MFC WIZARD!
ReplyOriginally posted by: Slowman
Don't be silent.OK??
Reply
Originally posted by: lam
Where can i get souce code?
ReplyOriginally posted by: Gabriel Praino
GetItemRect(GetRootItem(), rcRoot, FALSE );
If TreeList is empty, rcRoot is not filled, and
CRect rcRoot;
In OnPaint(), where it says:
the next for runs for years.
This line should be replaced with:
HTREEITEM hRootItem = GetRootItem();
if (hRootItem)
{
GetItemRect( hRootItem, rcRoot, FALSE );
rcRoot.left = -GetScrollPos( SB_HORZ );
}
else
rcRoot = CRect (0,0,0,0);
Originally posted by: Stefan Koronka
[and for all of you who ask for source code: the source is here, right under your eyes. can't you just copy&paste it ?!]
Originally posted by: Anupama
Hi
I tried to use your code in my application in PLatform SDK. Though i didn't find equivalent code for all your MFC code (eg .CWND::Onquerynewpalette).
But it is not working .Either the treeview overlaps the image or viceversa.
could you help me out please.
anupama
Originally posted by: Amit Pawaskar
The code written by Zafir Anjum is very good. But when you scroll the TreeView control it consumes a lot of memory and ultimately the machine hangs.This happens only in Windows95/98 and not in Win2000 . Does anybody have the solution for this ? Kindly mail me ..
Reply
Originally posted by: Paladin
where can I find Source code?
Urgent,Please!!!!!!!!!!!
Reply