|
Accordint to the documentation here[^] you should get the font specified in your resource script.
The best things in life are not things.
|
|
|
|
|
Some further research yields further information ...
As you say the font returned from a WM_SETFONT message is the system font (very odd). However, when you create your dynamic control, if you send a WM_GETFONT message to your dialog it will return the actual font in use by the dialog. I guess you could do the same with any control that uses a different font.
The best things in life are not things.
|
|
|
|
|
i want to drag and drop images in same list control .
Rajesh
|
|
|
|
|
Here[^] are some suggestions.
The best things in life are not things.
|
|
|
|
|
Hi all . I want ask you , in OnClick(NMHDR* pNMHDR, LRESULT* pResult) , how can I know which item is selected to retrieve tree item data ?
I try in follow way but I get always null :
void CMyViewTree::OnClick(NMHDR* pNMHDR, LRESULT* pResult)
{
CTreeCtrl& Tree = GetTreeCtrl();
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
HTREEITEM hSelItem = pNMTreeView->itemNew.hItem;
if(hSelItem)TRACE("%d\n",Tree.GetItemData(hSelItem));
else TRACE("null\n");
*pResult = 0;
}
Thank you.
|
|
|
|
|
|
I try this too , but it show me the previous item selected , not actual item ...
I know, my mistake , after the title seems to want the previous item , but I want to know whish item is selected .
|
|
|
|
|
Flaviu 2 wrote: I try this too , but it show me the previous item selected , not actual item
...
How are you verifying this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Like that :
void CMyListTree::OnClick(NMHDR* pNMHDR, LRESULT* pResult)
{
CTreeCtrl& Tree = GetTreeCtrl();
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
HTREEITEM hItemSel = pNMTreeView->itemNew.hItem;
if(hItemSel)TRACE("%d\n",Tree.GetItemData(hItemSel));
else TRACE("null\n");
hItemSel = Tree.GetSelectedItem();
if(hItemSel)TRACE("%d\n",Tree.GetItemData(hItemSel));
else TRACE("null\n");
*pResult = 0;
}
|
|
|
|
|
You are doing the check in the wrong place, I think. You should capture the TVN_SELCHANGED notification as described here[^].
The best things in life are not things.
|
|
|
|
|
You should be handling TVN_SELCHANGED instead of NM_CLICK .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
|
Hi!
I need to set Image to a CButton through code in MFC. I don't want to set through properties. I need to read the image path from an XML file and set it to the Button. How to set image through code? I also need to set Mouse Over image to a button. There is no Mouse Over event for Buttons. How to set the Mouse Over image in the same manner as above(reading the image path from an XML file and set it to the button).
|
|
|
|
|
Use ::LoadImage to load the image from the file as a bitmap.
Then use CBitmap::SetBitmap to set that as the bitmap for the button.
For the mouse over image, you need to set that in the WM_MOUSEMOVE message when the mouse is over the button.
In the WM_MOUSEMOVE handler, call TrackMouseEvent .
After this, WM_MOUSELEAVE message will be posted when the mouse leaves the area of the button.
|
|
|
|
|
Hi,
My machine has Win2008R2 OS and terminal services enabled. I am trying to open a socket. But immediately after connecting to the socket the connection is getting closed. Is ther anything related to terminal services that is causing this issue
When I disabled the terminal services.. everything is working fine.
Thanks
|
|
|
|
|
i have MSHTML::IHTMLDocument2Ptr pointer loaded with html document.there i can see all style sheets,images,iframe object. iframe object again will contain "src" attributes with source location. i want all iframe or frame objects "src" attributes from html document....
please help me
|
|
|
|
|
yogish293 wrote: have MSHTML::IHTMLDocument2Ptr pointer loaded with html document.there i can
see all style sheets,images,iframe object. iframe object again will contain
"src" attributes with source location. i want all iframe or frame objects "src"
attributes from html document.... please help me
You make Absolutely No Sense in a CPP Forum(I know you are desperate.)
In this forum, HTML is as common as ancient greek.
Bram van Kampen
|
|
|
|
|
I did my first website in pure HTML from a text editor...
...and btw, MSHTML is an HTML library, not straight up HTML...
|
|
|
|
|
Albert Holguin wrote: I did my first website in pure HTML from a text editor...
There are other ways?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Shh, such talk leads to Vi vs. Emacs flamewars...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
IHTMLDocument2::get_frame will give you an IHTMLFramesCollection2 interface.
Use IHTMLFramesCollection2::item to iterate through the collection.
Each iteration will give you an IHTMLElement interface corresponding to each frame.
Then use IHTMLElement::getAttribute to get the value of the SRC attribute.
|
|
|
|
|
_variant_t MSHTML::IHTMLFramesCollection2::item(VARIANT var); this is declaration of item function... there is no interface to get IHTMLElement...
|
|
|
|
|
The VARIANT will contain the IDispatch pointer of the frame element.
You can do a QueryInterface for an IHTMLElement on this IDispatch pointer.
|
|
|
|
|
for(long nfram = 0; nfram < pColFrames->length ; nfram ++)
{
_variant_t vIdx(i, VT_I4);
_variant_t vDisp;
vDisp = pColFrames->item(&vIdx);
if(vDisp.vt == VT_DISPATCH)
{
vDisp.pdispVal->QueryInterface(IID_IHTMLElement,(void**)&pElem);
...................//rest of operation
}
}
but always if(vDisp.vt == VT_DISPATCH) will fail...means vDisp.vt become empty.
|
|
|
|
|
Hi,
How can I load image from resource using gdi Image class?
|
|
|
|