|
If it does not have a type name then it will not have a default icon.
The best things in life are not things.
|
|
|
|
|
In the simple win32 program, I'm having two buttons on the dialog. The difference between the two buttons is that one is dynamically created with dialog as parent and the other button is statically placed on the dialog. But the two buttons appears to be different in the font. When I debug, I found the statically placed button is inheriting the dialog font (i.e. "Arial") while the dynamically created button (using CreateWindow()) is not. Do I need to set any flag while dynamically creating the controls ?
I found the same problem with the other non owner draw controls like label, so modified the post.
|
|
|
|
|
You need to capture the WM_SETFONT message in your dialog box procedure and save the font information to use in your dynamic controls.
The best things in life are not things.
|
|
|
|
|
Thanks. I instead put a member variable for my own font. Because even the WM_SETFONT was returning me the system font rather than the font from the Dialog Template.
|
|
|
|
|
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.
|
|
|
|