It seems that I have problem drawing ownerdrawfixed combo box, which is actually drawn in ownerdraw listbox control.
I am able to draw all items inside shown dropdown of combo box. But I can not draw anything to combo box "header".
1. What is actual message of drawing combobox "header" ? I got to conclusion that when itemID is -1 (after I call CB_SELECTSTRING) then it is "header" (Note: Seems that right rect is found in DRAWITEMSTRUCT) and I draw text than but nothing appears.
2. Currently I am trying to draw it after CB_SHOWDROPDOWN is set to true. Should it be done before that?
I'm guessing, handle the WM_DRAWITEM message in the parent window, then check the CtlID
member of DRAWITEMSTRUCT to see it's the correct combobox control, if so check the itemState member to see if it is ODS_COMBOBOXEDIT, and if so, draw the edit box (I think the edit box is what you mean when you say "header")control of the combobox.
I have one question regarding resolution. How to make a project created as a MFC dialog based application, resolution independent. I am using a number of images in our dialog based project. But the final display using images and controls is not resolution independent. To say if your PC screen resolution is different from the other, it will not properly display the dialog. Some of the part of dialog display will be cut-off.
How to make the same resolution independent, so that irrespective of the resolution of the device or screen size, display should be same.
Any help will be appreciated.
Also, what is the use of ActiveX controls in MFC.?
I assume that your dialog is created using a resource template.
The simple solution is to limit the size of the dialog to the minimum size of supported screen resolutions.
If your application must also run on small screens, you may add a second dialog template with smaller controls and smaller total size. Upon program start, choose the small template when necessary.
The complex solution would be making your dialog and some or all controls resizable. But this requires proper calculation for sizes and positions of all controls.
There is no need to use ActiveX controls if your application design can be done using the standard Windows and MFC controls. If you have special control requirements, you can build your own controls by using ActiveX or plain C++ code, or use existing controls that fit your requirements. Finally, it's up to you to decide to use ActiveX controls or not.
Thanx for your reply.
It is not that my project will run on smaller screeens only. It may run on larger screens also.
Let me explain, I have windows 7 & my PC screen is of bigger size (vertically as well as horizantally) (bigger than a normal LCD display). if I run my project on my PC, I am not able to see the controls on the bottom of the dialog. if I run my project on any PC with windows XP and screen size is small, it will display it perfectly.
I want to make it like that all the controls should adjust them accordingly irrespective of the resolution or PC screen size.