|
Hi,
If there 2 windows T1 and T2. How T1 will notify T2 by sending a message?
How 2 achieve this 1) if they are child and parent windows or
2) both are independent windows
Thanks in advance
MSR
|
|
|
|
|
Message can be sent to a window using SendMessage or PostMessage .
Both these functions take the handle of the destination window as a parameter.
So as long as you have the handle to a destination window, it doesn't matter if the windows are independent or have a parent-child relationship.
|
|
|
|
|
There's SendMessage[^] (which blocks until the recipient window process the message and returns a value) and there's PostMessage[^] which is a non-blocking call and therefore returns immediately. Based upon your requirements, choose one.
Additionally, RegisterWindowMessage[^] would help you register a unique message, which you might want to post or send.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi,
I have my CListBox, and it is displaying different groups of data. I would like each group header to be emboldened, but I am struggling to get any bold text.
If I had a CListCtrl I could use OnCustomDraw, but that functionality doesnt appear available to either my CListBox, or the parent Dialog.
What I want to achieve is this
Header1
Data1
Data2
Header2
Data1
Data2
Any help would be much appreciated
TIA
Tony
|
|
|
|
|
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
|
|
|
|