|
Hi all,
I am trying to derive a listctrl (only report view) with alternate row colors from CListCtrl. But I am confused how to implement this in OnPaint, OnEraseBkgnd or DrawItem...
Can anybody suggest me a good solution or any useful link?
Thank you.
- NS -
|
|
|
|
|
You can use "Custom Draw" to do this I think.
Steve
|
|
|
|
|
I tried... but only the rows those have content can be chnaged. I want to change all the rows to be changed, even if the listctrl is not fully filled.
- NS -
|
|
|
|
|
|
Thank you for the replay...
I could manage it by writing codes in OnEraseBkgnd as well as DrawItem.
- NS -
|
|
|
|
|
I want to place A Grid control on a document with a Background image . How do i make the Grid control transparent so that the background image is still visible ??
Thanks in Advance
Vijayeta
|
|
|
|
|
What grid control are you using ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
grid control of mfc2.6
vijayeta
|
|
|
|
|
Hey guys plz help me out
I want a help for manifest in VS 2005
Iam asked to test my project in different themes
so plz suggest me a gud article for Manifest in VS 2005
|
|
|
|
|
Hi, I wonder how does Cube and WindowFX and such applications work?
I'm interesting in developing a similar application but have no real clue as to where I should start looking for information.
Any and all information is more than welcome I have been researching this for some time but I seem to be stuck.
|
|
|
|
|
In my Application developed with VC6, I load the xml file and the xsl file from a string and put it in the memory, how can I represent the xml file formatted by the xsl file in a HtmlView ?
thanks for your replys!
-- modified at 4:42 Friday 14th April, 2006
|
|
|
|
|
|
appreciate for your help!
but i want to format in MFC programme, by the way, I load the xml file and xsl file from strings(not files), is there any other examples?
|
|
|
|
|
I know that:
LBN_SELCHANGE is sent when the selection state in a list box is about
to change.
I have a single-selection list box with 10 items. An item is selected
and the user clicks a different item. How do I know in the function
OnSelChange()
{ ... }
what item was selected and what item is currently selected. I know
that
m_listbox.GetCurSel();
tells me what current item is selected. How can I figure out what
item use to be selected before this new item was selected?
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
Simply maintain one variable and save the currently selected item
like this
{
static oldsel=0;
oldsel=lst.getcursel();
}
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
|
You could create a transparent window that covers the MSHTML window such that you can see through it, but it captures all the mouse and keyboard messages. Or you could subclass the MSHTML window and capture any mouse or keyboard messages that go to it.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan you're the man!!! Thanks so much... I like the transparent idea a lot... do you happen to know which dstyle that is off the top of your head ?
Thanks again!!!
|
|
|
|
|
Specify the WS_EX_TRANSPARENT window style, and implement message handlers for WM_ERASEBKGND and WM_PAINT that do nothing.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hey Ryan so I tried that... I am running into two problems:
1) The newly created window is there, but it doesn't take focus, even after I call setFocus(newWindowHdl);... this means that it won't hear any WM_ messages until I actually click the window to make it active.
2) It also overlaps the window below it, and I can't see the window below it until I actually drag the overlayed window somewhere....
ideas?
|
|
|
|
|
You don't need it to have the focus. I shoulda gave more info... sorry.
WS_EX_TRANSPARENT is an extended window style, so you'd pass it in as dwExStyle to the CreateWindowEx() function. Also, specify WS_EX_TOPMOST (also an extended window style) to place the window on top of any other windows. Make sure you don't have WS_BORDER or WS_OVERLAPPEDWINDOW set otherwise the border will overlap other windows. If you've done this and you make the window the full size of the DHTML window, then when you handle WM_PAINT and WM_ERASEBKGND as I mentioned before, your window will be completely transparent, but will capture all the mouse and keyboard messages that would have gone to the window.
By the way, in your WM_ERASEBKGND handler, make sure you return TRUE, and in your WM_PAINT handler, make sure you call BeginPaint() but don't actually do any painting.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan, that's very helpful! Now it works exactly how I want it to.... except
I have to click on the now invisible window once to get it to accept keyboarad input. Just to make things stranger, it accepts mouse input already great, but no keyboard input till I click.
Thus it seems WM_MOUSE events are caputred but WM_KEYDOWN never gets picked up until I click on the newly created invisible window.
Here's my call to the invisible window:
if ((hwnd = CreateWindowEx(WS_EX_TRANSPARENT | WS_EX_TOPMOST, "TransWindow", "An HTML string", WS_POPUP ,
200, 400, 50, 100,
hWnd, NULL, NULL, 0))){
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
}
Also another random thing is that immediately upon launching it closes if I use WM_MOUSEMOVE, even if
I activate the program with <enter>. So, maybe there's a of setting the timer to not check mouse movement for the first couple ms?
Thaanks in advance! I'm almost there!
|
|
|
|
|
chasetoys wrote: have to click on the now invisible window once to get it to accept keyboarad input. Just to make things stranger, it accepts mouse input already great, but no keyboard input till I click.
You can call SetActiveWindow() to fix that.
chasetoys wrote: Also another random thing is that immediately upon launching it closes if I use WM_MOUSEMOVE, even if I activate the program with . So, maybe there's a of setting the timer to not check mouse movement for the first couple ms?
I'm not sure what you mean by this...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
If you're using MFC you can just use the PreTanslateMessage mechanism.
Steve
|
|
|
|
|
appreciate the response, but i can't use MFC
|
|
|
|