|
What you can do is to use owner-draw listbox:
• Derive a class from CListBox and override CListBox::MeasureItem(), CListBox::DrawItem(), and PreCreateWindow() (to add LBS_OWNERDRAWFIXED or LBS_OWNERDRAWVARIABLE).
• Create an object of this class and call its Create() or CreateEx() function to create this control.
Note:
The parent of this list box will get one WM_MEASUREITEM for the whole list box if LBS_OWNERDRAWFIXED is used or one WM_MEASUREITEM for each item of the list box if LBS_OWNERDRAWVARIABLE is used. MFC will call the virtual function CListBox::MeasureItem(). The parent also gets WM_DRAWITEM, while MFC calls the virtual function CListBox::DrawItem(). Although the above two messages are sent to the parent, the virtual functions make it possible to handle some useful things by the list box. Through overriding these two functions, the self-controlling of the drawing process can be achieved for the list box.
|
|
|
|
|
|
Thanks for the link Superman, but that seems to relate to CListCtrl whereas I'm using a CListBox
Tony
|
|
|
|
|
Hello,
for my application's needs, I am trying to capture the whole desktop (including children windows), except the active window. I have the capturing code working, but I cannot find reference on how to ignore the active window. Can someone assist me?
This is on Win32, C++, No MFC.
Thank you for your time
|
|
|
|
|
Do you mean you need to capture the IMAGE of the whole desktop except the active window? The active window (shown on screen) will block the view of the desktop (such as windows behind it). When you say "except" the active window do you mean you want to capture the desktop as if the active window is not there (hidden)?
Your program can briefly hide the active window to capture the image, then restore the display status of the active window. But that will cause ugly view experience while it is doing this. I am not aware of a method that you can use to capture whatever image that is behind a certain window.
|
|
|
|
|
If it is desktop wallpaper that you want, you can get it using SystemParametersInfo with the SPI_GETDESKWALLPAPER parameter.
|
|
|
|
|
Hi,
Is it possible to set the size of the tab spaces on a CListBox? e.g. in Visual Studio you can configure the number of spaces that a Tab simulates - can this be done within a CListBox?
TIA
Tony
|
|
|
|
|
You cannot type within a CListBox , can you? So what sense does it make to have the number of spaces tab would simulate within a CListBox ?!
Pressing tab would take the focus to next control in the tab order by default. I'm not sure I understand your query well...
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi,
I probably didn't explain it well enough.
You can add strings to a List Box that contain \t to represent tabs. Currently the \t symbol translates to about 8 spaces, whereas I could do with it being about 4 spaces.
As an example, I am currently displaying something similar to this
Header
Data1
Data2
BUT I really would prefer something like this
Header
Data1
Data2
Any ideas?
Tony
|
|
|
|
|
Problem Solved,
I missed SetTabStops when looking at the ListBox members...
Thanks for focussing my thoughts
Tony
|
|
|
|
|
Hi,
I want to transform a black&white image into a binary image. I would like the background (black)to have 0 and the foreground(white) to have 1. I do not know how to proceed. I am implementing in C++ (QT).
Thanks in advance,
franckesh
|
|
|
|
|
franckesh wrote: I want to transform a black&white image into a binary image.
I am not sure what you are trying to achieve here, can you clarify your question?
|
|
|
|
|
Actually I have 2 images with black background and the object on the images are white. What I am trying to do is to compare them with an XOR. In order to do that I need to have them in a binary form(Black = 0 and White = 1). With The XOR operation the results will be "1" where the pixels do not match (1 XOR 0 = 1).
So now I want to figure out with QT how to have these images in a binary form and to perform XOR afterwards.
Thanks for the reply,
Franckesh
|
|
|
|
|
franckesh wrote: So now I want to figure out with QT how to have these images in a binary form and to perform XOR afterwards.
I don't know what QT stands for so I cannot comment on that. However, assuming both images are in the same format you just need to go through them pixel by pixel and compare the colour values. From this comparison you can build the binary array showing where the images are different.
|
|
|
|
|
Monochrome images already had black and white represented by the pair {0,1} (or viceversa).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Is there a tool to look into static libraries dependencies (.lib files)?
There are dll dependency walkers available but I could not find the one to dump .lib files contents.
I've got multiple .lib files where I need to discover the dependencies between them without looking into the actual source codes
Чесноков
|
|
|
|
|
Take the lib file and check the corresponding DLL with dependency walker and find the dependency, say [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
These are not DLL projects!
There are no DLLs in static library projects. Only .lib files are generated, much larger the .lib files supporting DLL modules from DLL libraries projects.
I need dependency walker that works only with .lib files from static library projects
Чесноков
|
|
|
|
|
As far as I know, in general, this is not possible. Since static libraries do not resolve where a symbols is coming from. So all dependent static libraries must be present when linking a static library.
-Saurabh
|
|
|
|
|
I don't know of a DW but you might find that the LIB Command[^] will offer some information that may help.
|
|
|
|
|
Hello,
I have read about COM programming and now want to use it in VC++ . Which dlls or libraries will i need to use COM.I have done automation and used automation classes to open word excel . Is it very similar to that ? I am confused.
Thank you
Pritha
|
|
|
|
|
prithaa wrote: Which dlls or libraries will i need to use COM.
It depends what you are trying to do. What functions are you trying to use in your program?
|
|
|
|
|
prithaa wrote: I have read about COM programming and now want to use it in VC++
Why do you _need_ to use it ? Is there a particular problem that absolutly have to use COM that cannot be done otherwise ?
Office Automation classes are COM objects (AFAIRemember); so there's a link there.
This signature was proudly tested on animals.
|
|
|
|
|
prithaa wrote: I have done automation and used automation classes to open word excel . Is it very similar to that ?
Yes, that's exactly what COM is. Automation is an IPC mechanism that is based on COM.
"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
|
|
|
|
|
But remember the best control you get with C++, so check BEFORE CODING whether all needed features are supported.
This looks like a great article for that stuff:
Accessing Excel Spreadsheets via C++[^]
Press F1 for help or google it.
Greetings from Germany
|
|
|
|