|
I've read a few articles about creating in VC++ 6 programmes with windows that minimize in the system tray. Is it possible to accomplish the same thing with C++ Builder?
|
|
|
|
|
Yes, you can make the same function calls to achieve the effect
|
|
|
|
|
http://www.bcbdev.com/faqs/faq73.htm
|
|
|
|
|
Hi:
I want to change the combobox's style in programme(want it could be edited or not),Can I set the "CBS_DROPDOWN " or "CBS_DROPDOWNLIST " style to the combobox in my programme?I use "modifystyleex",but nothing happen. How to do?
Thanks
Benben
|
|
|
|
|
When I was reading the CListCtrl::SortItems method, I noticed at MSDN there's a sample on how to sort items of a CListCtrl , the sample says:
Example
static int CALLBACK MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, 0);
CString strItem2 = pListCtrl->GetItemText(lParam2, 0);
return strcmp(strItem2, strItem1);
}
void snip_CListCtrl_SortItems()
{
extern CListCtrl* pmyListCtrl;
pmyListCtrl->SortItems(MyCompareProc, (LPARAM) pmyListCtrl);
}
While it says "The lParam of an item is just its index", I however found its actually the item's 32-bit data, usually 0. Why does MSDN say its an index? Is there some "hidden" way we can get the lParam's as indices? Thanks
|
|
|
|
|
|
Not a mistake in the context of this sample.
The lParam is a piece of data (pointer-sized, i.e. 32 bits on 32-bit Windows, 64 bits on 64-bit Windows) that can be associated with each item. You specify it in the lParam member of the LVITEM structure when calling InsertItem , or you can set it using SetItemData . The lParam values of the two items are passed to the compare procedure.
In this case, the sample code has simply assigned the item number to the lParam of the item. However, you could do something different, perhaps storing the record number of the source record, or a pointer to the object that the list item represents.
If you don't specify a value for lParam , it will be left uninitialised.
|
|
|
|
|
I think the design of this function was simply wrong in the first place. Why did they decide to pass item-data, not indices, to the comparing callback function? Item-data are easily obtainable through "GetItemData" function, whereas indices are difficult to obtain through item-data(no, FindItem won't work if two items have same item-data), even an idiot would see that is a one-way-linkage, yet the designer went ahead and picked the wrong route. Heehe, shame on whoever wrote that function.
|
|
|
|
|
There is system setting:
Big/small/custom size of system font in display properties.
How to get It programmatically ?
thanks
|
|
|
|
|
This is untested code, but should hopefully come up with the right answer
HFONT hGuiFont = ::GetStockObject(DEFAULT_GUI_FONT);
CFont font;
font.Attach(hGuiFont);
LOGFONT lf;
font.GetLogFont(&lf);
int size = -lf.lfHeight;
font.Detach(); // dont delete global resources
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
This may seem a little round-about:
GetDeviceCaps(NULL, LOGPIXELSX);
GetDeviceCaps(NULL, LOGPIXELSY); which gives you the number of pixels per inch in each direction.
Setting Small Fonts sets both to 96, Large Fonts sets both to 120, and Custom is something else.
|
|
|
|
|
Hi,
I want to produce a Font, of say size 10 points & with Character ratio 2. In the MFC,I have seen the "CreateFont" method which takes the width as
the 2nd parameter.But How will I get the width of a particular font with size
10 pts.
Could anyone help me regarding this.
Thanks in advance...
|
|
|
|
|
Not sure I understand what you mean. But if you want to know how much space (Wdith) a font takes, select your font in a device context and then use GetTextExtent.
Good luck!
|
|
|
|
|
Thanks for ur reply...........
But I want to know the width of the font,Before I Create the font. My aim is to provide a character ratio for the font.
Iam creating the font using the "CreateFont" method.In this Function,the 2nd parameter is width.So to Create a Font with a particular character ratio,I need to give in this 2nd parameter a value which is equal to (widthoffont * characterratio).
sO THATS why I want to know the width of the font before creating a font before.Is it possible?.
|
|
|
|
|
You will probably have to create this font in 3 stages.
1. Create it using normal parameters to allow windows to choose the correct width for the font height
2. Get the LOGFONT of this font
3. double the width value and CreateFontIndirect() using the LOGFONT
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hi,
I want to know the width of a font,Before I Create a font. My aim is to provide
a character ratio for the font.
Iam creating the font using the "CreateFont" method.In this Function,the 2nd parameter
is width.So to Create a Font with a particular character ratio,I need to give in this 2nd
parameter a value which is equal to (widthoffont * characterratio).
sO THATS why I want to know the width of the font before creating a font before.Is it
possible?.
I tried as u told:
CFont font:
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
font.CreateFont(-height,0,rotVal.x ,rotVal.y,style,FALSE,FALSE,0,ANSI_CHARSET,
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_SWISS,
reinterpret_cast(facename.c_str()));
// In "CreateFont" method Iam giving width as 0 in the 2nd parameter as I dont know the width in advance & I tried to get the width windows allocated using the logFont Structure. But Iam not getting the width windows allocated instead Iam getting '0' which I gave in the "CreateFont" method.How is it possible to get the width windows allocated.
Would be nice if someone tells me how to achieve this....
font.GetLogFont(&lf);
long width = lf.lfWidth;
font.CreateFontIndirect(&lf);
Thanks in advance.........
|
|
|
|
|
i need to boot from flash. OS can be win98 or linux.
how can i do that
|
|
|
|
|
Call me a sceptic, but USB technology is still kept in the dark due to very large $$$ potential to private companies.
|
|
|
|
|
Set your BIOS to use the USB as a boot device and have your flash-stick formatted as a bootable device.
Now it SHOULD work....
If it does, you have the reassuring knowledge that you are far ahead of the common mob.
In other words, it seems to be plain luck.
Newer computers and notebooks tend to do better with USB than older desktops.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Hi All
does ne1 know how to add an HTML help to a sdi appplication genertated in Visual Studio 2003
normally this would be created at the start of the project, but i didnt think that i would require
one, however i now need to add one to my project
does anyone know how to do this
thanks
simon
|
|
|
|
|
Hi
Now I develop a control derrived from static text.
In PreSubclassWindow() I need to call GetFont(). If control is created via dialog editor everything is OK, but when I try to create it in OnInitDialog() handler using Create() method, GetFont() returns NULL.
Why is it so.
____________________
Best regards,
v0id
|
|
|
|
|
Just a stab in the dark, but I think if your call GetFont() before CDialog::OnInitDialog(), the dialog as not been initialised/created, therefore will bomb out.
Try it after the base function is called and see what happens
I Dream of Absolute Zero
|
|
|
|
|
This is a guess, but by the end of the stadnard OnInitDialog, wit hte controls created, the CDialog bass class code calls setFont on each control to set the font to use.
As your doing the Create() calls manually, not font is being set. he control will render with the default GUI font (GetStockObject(DEFAULT_GUI_FONT)), but will return NULL as no specific font to use has been set.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
hi all,
i want to write a program that alows videochating,i do not know how to capture image from webcam, and how to compress it. Can any one help me?
thanks.
|
|
|
|
|
Get the DirectX SDK and look thru some of the samples. http://www.microsoft.com/windows/directx/default.aspx
|
|
|
|