|
which message i should pass for selecting item in listControl.
|
|
|
|
|
try this
LVM_SETSELECTIONMARK
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
If you are using MFC, use the CListCtrl::GetNextItem(-1, LVNI_SELECTED) method.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
will this function return me the current item ..when i tried this function it give me error
"LVS_SELECTED is uncdeclare identifier"
thanx
|
|
|
|
|
|
This is not implemented :-
LVS_SELECTED
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
We have a custom control ( similar to tree control ) in which we can insert columns. In one of the columns i want to have check boxes.
I need some pointers as in how to do it as the original developer of the control is not with us.
kaps
-- modified at 6:38 Tuesday 11th July, 2006
|
|
|
|
|
hi
i want to place a wallpaper on dialog box
plz tell me code how to use wallpaper on dialog box
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
I think you asked this question yes(i usually remember questions) Load your picture and use WM_PAINT or WM_CTLCOLOR or WM_ERASEBKGND
whitesky
|
|
|
|
|
thanks sir
but can you tell me the code for this
Ashish Dogra
MCA
Noida
|
|
|
|
|
you answerd always "can you tell me the code for this" yes
include atlImage.h
CImage m_Image;
m_Image.Load(filename);
<br />
m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0));<br />
use this code in WM_PAINT <br />
whitesky
|
|
|
|
|
sir this will give error as
: fatal error C1083: Cannot open include file: 'AtlImage.g': No such file or directory
as i use 'AtlImage.h'
Ashish Dogra
MCA
Noida
-- modified at 6:41 Tuesday 11th July, 2006
|
|
|
|
|
You need to include AtlImage.h
whitesky
|
|
|
|
|
yes sir i include AtlImage.h plz solve my problem
Ashish Dogra
MCA
Noida
-- modified at 8:01 Tuesday 11th July, 2006
|
|
|
|
|
ashish dogra wrote: yes sir i include AtlImage.h plz solve my problem
Did you even bother to search for a solution? It is assumed that you will at least put forth some effort to go along with the suggestons you receive here.
http://www.codeguru.com/Cpp/COM-Tech/atl/graphics/article.php/c3597/[^]
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
sir plz tell me why my application does not include AtlImage.h
sirplz fast
Ashish Dogra
MCA
Noida
|
|
|
|
|
if you get this error so you dont have this file in your computer and you can see msdn for it
whitesky
|
|
|
|
|
You can do it by handling WM_CTLCOLOR
Follow the below steps,
CBitmap m_hBitmap; //Declare in class
m_hBitmap.LoadBitmap(filename); // Add this in Constructor
m_hBitmap.DeleteObject(); // Add this in Destructor
Use the following code in WM_CTLCOLOR handler, before the return statement
if (CTLCOLOR_DLG == nCtlColor) //nCtlColor is the 'in' parameter
{
hbr = ::CreatePatternBrush((HBITMAP)m_hBitmap.m_hObject);
}
|
|
|
|
|
thanks but it does not work
but i use this code and no wallpaper is appeared
CBitmap m_hBitmap; //Declare in class
m_hBitmap.LoadBitmap("D:\\pics\\image001.jpg);
if (CTLCOLOR_DLG == nCtlColor) //nCtlColor is the 'in' parameter
{
hbr = ::CreatePatternBrush((HBITMAP)m_hBitmap.m_hObject);
}
Ashish Dogra
MCA
Noida
-- modified at 7:48 Tuesday 11th July, 2006
|
|
|
|
|
that will work if you have the bitmap in the resource.
if you are using the bitmap from file, then use the following code,
HBITMAP hBitmap; //Declare in Class
hBitmap = (HBITMAP)::LoadImage(NULL, "C:\\filename.bmp", IMAGE_BITMAP, 0,0,LR_LOADFROMFILE); //in Constructor
::DeleteObject(hBitmap); //in destructor
//Add in WM_CTLCOLOR handler
if (CTLCOLOR_DLG == nCtlColor)
hbr = ::CreatePatterhBrush(hBitmap);
|
|
|
|
|
thanks
but these are errors
'CreatePatterhBrush' : is not a member of '`global namespace''
'CreatePatterhBrush' : undeclared identifier
'=' : cannot convert from 'int' to 'struct HBRUSH__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
in the
hbr = ::CreatePatterhBrush(hBitmap);
Ashish Dogra
MCA
Noida
|
|
|
|
|
ashish dogra wrote: 'CreatePatterhBrush' : is not a member of '`global namespace''
'CreatePatterhBrush' : undeclared identifier
It helps to spell the function correctly.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thats
::CreatePatternBrush(..)
|
|
|
|
|
if you want to use brush in ctlcolor use
<br />
CBrush *m_brush;<br />
CBitmap m_Bitmap;<br />
m_Bitmap.Attach(LoadImage(...));<br />
m_brush=new CBitmap(&m_Bitmap);<br />
now in ctlcolor return m_brush->GetSafeHandle();//i think this (GetSafeHandle) i dont have vc now
in the end delete m_brush
whitesky
|
|
|
|
|
i want to display different bitmaps of digital no. in subclass static control.i have created an array of handle of HBITMAP and i am getting all the handle in constructor. when i am trying to access from a click of button in dialog its not displaying the digit.
code is below:
// this the derived class constructor
CNewstatic::CNewstatic()
{
for(int i=0;i<=11;i++)// code for getting the handle
{
HBITMAP temp = (HBITMAP)::CreateMappedBitmap(AfxGetApp()->m_hInstance, IDB_BITMAP1+i, 0, NULL, 0);
m_hBitmap[i] = (HBITMAP)::CopyImage( temp, IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG | LR_COPYDELETEORG);
}
}
after a button click i am accessing the objects in a method//
void CNewstatic ::OutPut(int digit,int pos)
{
CRect rect;
GetClientRect(&rect);
m_w = rect.Width()/8;
m_h = rect.Height();
pos =0;
//CBitmap* pBitmap ;//CBitmap::FromHandle( m_hBitmap[digit]);
CClientDC dc(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
//pBitmap->LoadBitmap(IDB_BITMAP1);
CBitmap* pBitmap = CBitmap::FromHandle( m_hBitmap[0]);
CBitmap* pOldBitmap = dcMem.SelectObject(pBitmap);
dcMem.SelectObject(pOldBitmap);
int f = dc.StretchBlt(m_w*pos, 0, m_w, m_h,
&dcMem, 0, 0, m_bm.bmWidth, m_bm.bmHeight, SRCCOPY);
if(f)
AfxMessageBox("Create");
else
AfxMessageBox("Not Create");
dcMem.DeleteDC();
}
it gives create message after clicking the button but image is not displayed .
please tell me the reason and solution of the problem.
|
|
|
|