I have a _non-MFC_ dialog-based app with a tree view. Everything is working very nicely (thanks to some great code examples by Bengi on this site). However, at the moment the only way of ending the label editing of a tree view item is to click elsewhere in the window. I would like it to behave like Windows Explorer, so that if the user presses Escape or Enter, the TVM_ENDEDITLABELNOW is sent to the treeview and the label editing is ended. However, I cannot get this to work at all. I have tried sending the message under WM_CHAR and WM_KEYDOWN with case VK_RETURN and VK_ESCAPE, but no joy. I have read elsewhere that it is difficult setting this up, but haven't been able to find a solution.
Could anybody tell me how I can go about doing this?
Unfortunately I'm relatively new to coding C++, and I don't know how to go about implementing the advice given in that article.
From the article:
"To work around this problem, subclass the edit control in response to the TVN_BEGINLABELEDIT notification that is sent by the tree view control when the tree view is about to start label editing for an item. To obtain the edit control's window handle, send the tree view control a TVM_GETEDITCONTROL message.
The subclass procedure should handle the WM_GETDLGCODE message by returning DLGC_WANTALLKEYS. This allows the tree view's subclass procedure to handle ESC and ENTER keystrokes."
So, if I understand correctly, I need to subclass my tree view control here:
I have a listbox in my _non-MFC_ dialog-based app, and I need to have a horizontal scrollbar for when the text extends out of the listbox. I know that you have to set LB_SETHORIZONTALEXTENT to get this to work (why oh why didn't they make it as easy as the vertical scrollbar?), but I have had no joy in getting it to work. I guess that this is what I need to do:
1) Whenever items are added to the listbox, or the listbox is resized, find the longest string (using strlen()).
2) Calculate the width of that string in pixels.
3) Set LB_SETHORIZONTALEXTENT to the calculated number.
Steps 1 and 3 are easy, but it's step 2 I have problems with. How can I find the width in pixels of the longest string? The only examples I can find are all written in MFC, which doesn't help as I can't find the equivalent non-MFC functions (eg. CDC::GetTextExtent).
I anyone can tell me how to find the width of a string in a listbox in pixels without using MFC, or just tell me how to get the horizontal scrollbar working in a non-MFC listbox, I would be very grateful.
I have been looking at some of the examples that show how to use tabCrtl. The thing is that I found some where the dialogs were Cdialog instead of of being managed by a tabCtrl class. I now know how to do them (Thanks folks). One problem is that when using the key 'tab', I am not able to move to the different windows. Has anybody solve this problem?
Also tried one that was using stricly tabCtrl classes, but now don't know how to use the events when a button is pressed.
Could anybody share an example of a program that uses tabCtrl and has some buttons with a function behind?
I have a dialog that is dll. This dll gets launched by a COM server control. For some reason, the dialog when it gets launched cannot be repositioned. The dialog's controls work, but I cannot move the dialog. I have tried to interrogate the dialogs "IsEnabled" accessor - it returns true. What is the atribute of the dialog that is controlling this behavior?
I have alreay tried that. When the dialog comes up, it's controls are active - I just can't reposition the dialog by clicking on it and dragging the mouse. It seems that it is frozen over it's parent. This dialog is wrapped in a different dll than the parent.
Any additional help is certainly appreciated
Pull from the thread Davide's library is a wrapper for a library called exif which possibly has the ability to write to a JPEG as well as reading. It might contain info on the particular tags you're interested. Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Where are you seeing such information (i.e., I've not know graphic files to contain such information)? While the JPEG didn't define a format per se, a de-facto standard is JFIF (JPEG File Information Format). Unfortunately, I'm unable to find a good read on it. The few available from www.wotsit.org were of no help.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
I don't know if this is still the same - but I think I ran into this problem a while ago. The JPEG standard itself is only for compression using DCT methods - it has nothing to do with storing of information about the image. I had this problem when trying to extract the height and width of the image - there is no data stored in a header - there is no header - it is just compressed data and as far as I can tell the width and height are determined from the structure of the data at a later time. You can get TIFF files that surround the JPEG compression and have very rich tag content then but the jpg file - so called - is just data. It may be that people are now calling this TIFF file a JPG file - which is now really confusing things.
I am writting a simulation program that represents components using images (bitmaps) in MFC. There can be several on the screen at a time. I didn't want to change the bitmap size every time the user wanted to zoom in or out in the view.
I am using SetWindowExt and SetViewportExt to do view scaling...works fine except the when I zoom out (bitmaps get smaller than actual size) the bitmaps begin to look bad. Does anyone know how to do the view scaling so that the bitmaps don't look so bad while zoomed out. I know that there are algorithms that can do bitmap scaling, but I wanted to avoid rescaling every bitmap each time the user changes view scales.
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks