Log in

View Full Version : Guidance Required


peterg70
March 17th, 2002, 00:14
Okay guys I'm stuck

I have a little proggie which has a dialog box that is a combo box. This is a real pain to use. I want to be able to change this combo box to a list type box and change the size of the dialog box etc so that it is a big screen.

So first i thought great use exescope or reshacker to do this but proggie was UPX packed. Not a prob Load up Procdump and dump the proggie.

Check dumped version and it runs okay but exescope/reshacker still thinks it packed.

Looking at Sections I have UPX0 UPX1 .rsrc and .idata

The .rsrc had the wrong section flags so i fixed them up but exescope still won't look at it

It still thinks the proggie is compressed and tells me so

TIA
peterg70

crUsAdEr
March 17th, 2002, 00:18
Try use PEditor to look at the resource section see if you can see it?

You can also try Pe Explorer 1.60 at Heavenstool, very nice program...

regards

ZaiRoN
March 17th, 2002, 00:21
Hi peterg70,
try to unpack using "upx -d <filename>"

bye,
ZaiRoN

peterg70
March 17th, 2002, 00:52
Binh81

Downloaded the PE Explorer (Nice Program)

It actually unpacked the proggie for me and showed me the resources but wouldn't let me edit the resources. Must find out why i can't type in the resources????

So i saved it out and exescope had no problems editing it.

Although still haven't been able to change the combo box to a list box yet. Any thoughts.

ZaiRon : I had tried that but refused to unpack.

fALC0N
March 17th, 2002, 02:47
Get eXescope version 4.21 or 4.1 from the web and try

Clandestiny
March 17th, 2002, 04:42
Hiya peterg70,

I'll just throw out my 2 cents here...

First, what type of combo box are you dealing with here? Generally speaking, a combo box is made up of an edit control AND a list box. Depending on the window style, however, it may only have the edit box or the list box component.

------------------------------------------------------------------------------------------------------------------------------------------------
The following list shows the three combo box types and indicates whether each includes a drop-down list and an edit control:

Combo box type: Drop-down combo box
Drop-down list = Yes
Edit control = Yes

Combo box type: Drop-down list box
Drop-down list = Yes
Edit control = No


Combo box type: Simple combo box
Drop-down list = No
Edit control = Yes
------------------------------------------------------------------------------------------------------------------------------------------------

So, I guess what I'm asking is... Are you trying to modify the *type* of combo box from say a Drop-down combo box to a Drop-down list combo box or are you trying to change the Combo Box to an entirely new "List Box" control.

The first modification would be a simple change of window style (CBS_DROPDOWNLIST specifying a Drop-down list for example). Although it's probably the most straight forward to make the changes in a resource editor as you've been attemping, changing the window style run-time is another option.

The SetWindowLong function changes an attribute of the specified window. The function also sets a 32-bit (long) value at the specified offset into the extra window memory of a window.

------------------------------------------------------------------------------------------------------------------------------------------------
LONG SetWindowLong(

HWND hWnd, // handle of window
int nIndex, // offset of value to set
LONG dwNewLong // new value
);


Parameters

hWnd

Identifies the window and, indirectly, the class to which the window belongs.

nIndex

Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus 4; for example, if you specified 12 or more bytes of extra memory, a value of 8 would be an index to the third 32-bit integer. To set any other value, specify one of the following values:

Value Action
GWL_EXSTYLE Sets a new extended window style.
GWL_STYLE Sets a new window style.
GWL_WNDPROC Sets a new address for the window procedure.
GWL_HINSTANCE Sets a new application instance handle.
GWL_ID Sets a new identifier of the window.
GWL_USERDATA Sets the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.
------------------------------------------------------------------------------------------------------------------------------------------------

If, however, you're trying to change the control to an *entirely* new control type (ie. from a "Combo Box" to a "List Box", then you're dealing with a whole different animal. Changing the control in the resource editor will not be enough. Functionality will have to be modified to account for the differences in message handling between Combo Boxes and the List Boxes. For example, if your combo box is initialized with strings it may be using the CB_ADDSTRING message to add those strings. If you changed this to a List Box you'd have to hunt down this CB_ADDSTRING and change it to its equivalent LB_ADDSTRING message.

I didn't see a reference to your target... So to be honest, I proably don't have a clear grasp of what you're trying to accomplish. I'm just throwing out a couple of ideas that may / may not be related to your problem at hand

Cheers,
Clandestiny

peterg70
March 17th, 2002, 08:41
Thanks for the Info Clandestiny (your 2 cents worth goes a long way)

I didn't name my target because it wasn't really relevant to the task.

To clarify my situation I have attached a picture of what i have.

The combo box is populated by a text file by the program.
But this only displays one item unless i click and scroll in the combo box.

I want to have a list which can also scroll but displays more items in the default display.

If this doesn't make it any clearer I let you know the name of the proggie (its not commercial). I just want to improve the interface to make it easier to use.

Kayaker
March 17th, 2002, 10:44
Aha! So a picture really is worth a thousand words ;-)

I think what the problem here is Peterg70 is that the programmer didn't make the height of the combo box large enough to include the space of the items within it. There are 2 ways to create a combo box, either as a control in a resource file, or runtime with CreateWindowExA and the COMBOBOX class.

In an .rc file a combobox would be created like this:

COMBOBOX IDC_COMBOBOX1, Left, Top, Width, Height, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CY of combobox must be big enough to hold all items

Check to see if the combobox is in a resource file (you can probably dump the resources as an .rc file with Reshack or Exescope) and try increasing the Height value. If you want to change it to an editable combo box or list box then you could probably do that too, but there's the caveat that Clandestiny warned about.

If created runtime with CreateWindowExA, you could again reverse the call by changing the appropriate values. Take a look at the ComboBox proc in the MASM32 package for how it would be called:

-------------------------------------------------------
ComboBox proc aWORD,bWORD,wdWORD,htWORD,hParentWORD,IDWORD

; ComboBox PROTO WORD,WORD,WORD,WORD,WORD,WORD
; invoke ComboBox,200,10,150,250,hWnd,700

szText cmbBox,"COMBOBOX"

invoke CreateWindowEx,WS_EX_CLIENTEDGE,ADDR cmbBox,0,
WS_CHILD or WS_BORDER or WS_VISIBLE or \
CBS_HASSTRINGS or CBS_DROPDOWNLIST or WS_VSCROLL,
a,b,wd,ht,hParent,ID,hInstance,NULL

ret

ComboBox endp
---------------------------------------------------------

Hope this helps,
Kayaker

peterg70
March 17th, 2002, 12:43
thanks guys Will have another hack at it.

Have tried this
From Exescope
object ComboBox1: TComboBox
Left = 8
Top = 24
Width = 561
Height = 421 *INCREASED by 400
ItemHeight = 213 *INCREASED by 200
TabOrder = 1
end

No difference in the display.
Changing the actual form and moving buttons worked but the combo box stayed the same.
Also the PE Explorer proggie is a very nice program. It has a built in plugin for unpacking UXP files. If more plugins appear I think this program has alot of potential.

peterg70

Late Breaking News:
I added "Style=csSimple" and the combo box changed to what i needed. Bugger of a thing