|
Can you be more specific
|
|
|
|
|
Aahh WhiteSky you are to be my saviour again!
Ok, its like this--I am designing an application to play audio files and that has a Slider. Now, using MCI,i can see a slider but i would like to customise the slider to be able to show some pic or something.
Is this even possible?
On something slightly related how does one use the slider to forward/rewind the music/video currently being played?
|
|
|
|
|
(First you can see a example in MSDN im sorry i dont know its name but i think this example is in VC6.0 for show avi files and it can show length from wave files and...)
you open your file with MCI_OPEN then you can get a hwnd to mci MCI_DGV_STATUS_HWND
and you can set position form your window /you can calculate length file and convert to time
and create your slider that its better.i wrote this program but i forgot it if i can find it in my computer
i send for you
See MCI_PAUSE and MCI_PLAY
|
|
|
|
|
Hi all..
I am trying to handle TAB key on keyboard while writing in Edit box.
User has to eneter data in EditBox and when he press TAB Key then cursor has to focus on next EditBox.
So You guys helpme in how to handle tab key while cursor is focued in edit box.
Thanking You.
Sheshidar Patnam
|
|
|
|
|
sheshidar wrote: ...when he press TAB Key then cursor has to focus on next EditBox.
This is the default behavior. You have apparently added code to change that.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
sheshidar wrote: when he press TAB Key then cursor has to focus on next EditBox
As David said this is a default behaviour..
Check all the Edit Controls have the sequence tab position..
Press Ctrl+D, in the dialog during design time to change the tab settings..
Do your Duty and Don't expect the Result
|
|
|
|
|
Look up the WM_GETDLGCODE and the DLGC_WANTTAB message for details on how to alter the default special handling of the tab key. You may also be interested in the IsDialogMessage API.
Steve
|
|
|
|
|
How can I get a HBITMAP handle from a CImageList Object?
I have a CImageList Object already. And I want to change it into a HBITMAP.
How could I do so?
Thank you!
|
|
|
|
|
Have you seen CImageList::GetImageInfo ?
|
|
|
|
|
|
See
m_ImageList->GetImageInfo(...);
-----------------------And-----------
You can use From ExtractIcon(index) for get a hicon of list and
draw this icon to a dc and save this dc to a bitmap
this code is an idea maybe its not good but if you want to checking this code its working.
<br />
CImageList* m_ImageList;<br />
CBitmap Bmp;<br />
m_ImageList=new CImageList();<br />
m_ImageList->Create(32,32, ILC_COLORDDB,0,0);<br />
Bmp.LoadBitmap(IDB_BITMAP1);<br />
<br />
m_ImageList->Add(&Bmp,RGB(100,105,0));<br />
m_ImageList->Add(&Bmp,RGB(100,105,0));<br />
<br />
CDC dc;<br />
CBitmap p;<br />
CImage m;<br />
dc.CreateCompatibleDC(GetDC());<br />
p.CreateCompatibleBitmap(GetDC(),32,32);<br />
dc.SelectObject(p);<br />
<br />
for (int i=0;i < m_ImageList->GetImageCount();i++)<br />
{<br />
dc.DrawIcon(0, 0, m_ImageList->ExtractIcon(i));<br />
m.Attach(p);<br />
m.Save("c:\\0.bmp");<br />
m.Detach();<br />
}<br />
<br />
<br />
|
|
|
|
|
Thank you very much.
but there is still a problem.
the bmp that saved have a black background.
how could I change the back colour into what ever I want??
And It is much better that you don't use CxImage.
-- modified at 7:57 Friday 25th August, 2006
|
|
|
|
|
Tcpip2005 wrote: the bmp that saved have a black background.
how could I change the back colour into what ever I want??
You mean to say, you want to change BMP, is it?
Tcpip2005 wrote: And It is much better that you don't use CxImage.
??
|
|
|
|
|
Yes,change the backgroud colour.
change black background into red,for example.
|
|
|
|
|
I'm not sure, if its possible.
|
|
|
|
|
Its possible(he needs a little work for it)
|
|
|
|
|
WhiteSky wrote: Its possible(he needs a little work for it)
ya tru, its more than little.
|
|
|
|
|
DrawIcon(you need to calculate x from icons in your listimage,0,m_ImageList->ExtractIcon(i))
Tcpip2005 wrote: It is much better that you don't use CxImage
?!CImage
|
|
|
|
|
void CSaveBmpToFileDlg::GetImageFromList(CImageList *lstImages, CBitmap* destBitmap)
{
CImageList tmpList;
tmpList.Create(lstImages);
IMAGEINFO lastImage;
tmpList.GetImageInfo(0,&lastImage);
CDC dcMem;
dcMem.CreateCompatibleDC(GetWindowDC());
CRect rect (lastImage.rcImage);
destBitmap->CreateCompatibleBitmap (this->GetWindowDC(),
rect.Width () * tmpList.GetImageCount(), rect.Height ());
CBitmap* pBmpOld = dcMem.SelectObject (destBitmap);
for (int i=0;i<tmpList.GetImageCount();i++)
{
tmpList.DrawIndirect (&dcMem, i, CPoint(i*rect.Width (), 0),
CSize (rect.Width (), rect.Height ()), CPoint (0, 0));
}
dcMem.SelectObject (pBmpOld);
}
I got this code. the bmp itself was nice.but still,the back was black
|
|
|
|
|
In this example we have a 32x32 and if you calculate x for x for draw function then your problem solve but if you want to get x& y from icons in CImageList see ImageList_GetIconSize(yourlist,x,y) and then insert x to current position in DrawIcon if you test this code and your problem is slove i glad but if you have previous error reply to me
|
|
|
|
|
Thank you sir.
I tried to do as what you have said.
the bmp file was saved correctly.
but the background was still black.
I want to change the background into RGB(255,0,255).
How could I do so?
Thank you very much.
|
|
|
|
|
for black background dc.DrawIcon(x/*32*/, 0, m_ImageList->ExtractIcon(i)); i used 32x32 for your icons you need to calculate x and y
for change background you can use from:
you need to two CDC objects one for draw icon and another for draw previous dc in new dc(for change color)
1-create two dc(dc1,dc2)and create two bitmap
2-in dc1 you draw icon
3-in dc2 you need to set color for bitmap and draw dc1 to dc2
4-then save this dc
it seems that its hard but when you start to this work its not hard also you can find examples for this purpose in bitmap i think i see examples for example you need to draw many pictures to a picture if you write this program then its very helpful in your programming.
|
|
|
|
|
You can try this
HBRUSH hbr;
hbr = ::CreateSolidBrush(RGB(255,255,255)); //this will draw white BackGround before drawing ICON onto it.
DrawIconEx(hDC,0,0,hIcon,0,0,0,hbr,DI_DEFAULTSIZE);
Matt
|
|
|
|
|
Hi Gurus
Couple of questions.
1) While using ReportEvent function to log an event, do we have to provide user id explicitly if we have to retrieve the user name when reading data from the event log? If so any sample code on how to get the current user id to use in ReportEvent function.
2) Any code sample to how to retrieve userid from ReadEventLog function and converto sid to username.
Thanks
C++beginer
|
|
|
|
|
Is there a function like fgets() but to read repeatedly every line from a string array like this?
char buf[] = "line1\n
line2\n
line3\n
...
";
9ine
|
|
|
|