|
Hai Friends,
I am in need to change the height of the drop down list
of a combo box.
When a combo box is clicked, it shows only the first 8 items
and remaining items can be scrolled to view.
How to increase the height of this drop down list to
view the desired number of combo items.
I tried using MoveWindow API
<br />
int ListHeight;<br />
ListHeight=SendMessage(Combo.hWnd,CB_GETITEMHEIGHT,0, 0);<br />
ListHeight=ListHeight*(Combo.GetCount());<br />
MoveWindow(Combo.hWnd,Combo.Left,Combo.Top,Combo.Width,ListHeight,1);<br />
But does not work as we wish.
Thanks for your help.
|
|
|
|
|
combo box contains 3 windows, combo, edit, list.
u have to change the height of list, in ur code u r trying to change the height of combo box.
u can change the height in resource editor,
if u want to change the height programmatically, try setting the size to list window, the handle to list box can be obtained from, CB_GETCOMBOBOXINFO message.
|
|
|
|
|
1/ In the resource editor, click on the drop down arrow for the combo box - this will give an outline of the drop down box, and you can change that
2/ Try using CM_SETMINVISIBLE - I've not used this, but it looks useful.
3/ Alternatively, use CB_GETCOMBOBOXINFO to fill in a COMBOBOXINFO structure (don;t forget to fill in it's cbSize first). This will give you the window handle to the List control it uses for the drop down part. You can then use
SetWindowPos (NULL, 0,0, cx,cy, SWP_NOMOVE | SWP_NOZORDER); to change the size.
I hope that's given you enough ammunition!
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
poda wrote: How to increase the height of this drop down list to
view the desired number of combo items.
Employ a smarter combobox.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for you replys friends.
But CB_GETCOMBOBOXINFO is undefined in my system.
What SDK should I install to get it work.
Please give me the link to update my SDK.
The winuser.h header does not have such #define.
My system is WinXP with SP2 and SDK is March 2006 Release.
|
|
|
|
|
#if(_WIN32_WINNT >= 0x0501)
#define CB_GETCOMBOBOXINFO 0x0164
#endif /* _WIN32_WINNT >= 0x0501 */
is defined like above in winuer.h. define _WIN32_WINNT >= 0x0501.
if not found install the latest SDK.
|
|
|
|
|
Hi All
How can i get the Cursor(Which pointer is used like Pointer or Hand or Help ect) of the Mouse?
Any help will be highly appriceated.
Thanks in advance
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I have HCURSOR handle using GetCursorInfo function.
now how can i extract information of mouse icon from this handle?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Do you want to set the Mouse Cursor in your application to hand/hourglass etc? See SetCursor with IDC_HAND etc
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks for your reply
But i don't want to set Cursor, i want to get it.
i.e. Whenever the Cursor changes from one type to another then my application should come to know that now cursor is changed and with which type.
Is this possible?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I think the handle to system cursor return from LoadCursor(IDC_WAIT/...) return the unique same value everytime for the same cursor.
u can compare the handle to the handle returned from GetCursor.
and also i think u can compare that at WM_SETCURSOR notification.
but why u need to know the state of app from the cursor, normally u will be setting the cursor for ur application, then u are able to know the current cursor without quering from the cursor.
|
|
|
|
|
No this is not the case.
I am developing application for screen sharing.
In that i want to pass the type of mouse cursor just like (HAND, HELP, WAIT,...)
I can also get the HCURSOR handle and by comparing it with inbuilt type i am getting cursor, but problem is with application that uses custom cursors like flash uses.
So is there any other alternative then this one?
CURSORINFO cInfo;<br />
cInfo.cbSize = sizeof(cInfo);<br />
if(cInfo.hCursor == LoadCursor(NULL, IDC_HAND))<br />
{<br />
}
This works fine when cursor is of system type
Now it will broken when i use it with flash because flash uses custom cursor so cInfo.hCursor will give some long values.
Now i think you should understand my problem.
If is there a way to know the type of cursor just like this is a cursor of type hand
Thanks for your kind reply
please help me on this.
Thanks
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I would like to know why u need the type of cursor,
if u want to use the same cursor on different process, use the handle, it is shareable among process [^], to use on different machine u can pass the image of cursor (for once).
if u want to identify the type of cursor and there by determine the state of application, it is upto the application, for instance i can use WAIT cursor to indicate the purpose HAND.
|
|
|
|
|
Is there any Event fire when mouse cursor change?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
|
what about adding the exe as resource.
|
|
|
|
|
ya excatly, do u know any thread in codeguru????
|
|
|
|
|
u can search for it,
but actually it is very easy,
1. add the exe as custom resource
2. load the resource LoadResource()
3. Get the buffer pointer to the resource using LockResource().
4. Then save the data to a file.
if u refer the api u will get the example code.
|
|
|
|
|
|
swarup wrote: got it, i think i was being a bit lazy. sorry for that....
so developer forums making programmers lazy.
modified on Thursday, February 21, 2008 2:45 AM
|
|
|
|
|
swarup wrote: any thread in codeguru
Try looking at the top of the web page. You see the logo of an alien? What do the words next to it say? In big letters?
If you want to know about threads on codeguru, then you might be better *asking* on codeguru.
I'm pretty sure there are articles all about embedding and extracting abritrary resources in executables here on codeproject but apparently you are not interested in them...
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
thanks, i looked for it, did nt get, thts why the request, if u cant do by urself thn only u ask for help,ppl dont simply ask for help.........
|
|
|
|
|
I have no problem with people asking for help - what you're trying to do is not easy. I helped someone with a very similar problem last week, so please look back a few days for my name in a chain conversation.
It just amused me that you were posting on codeproject asking about threads on a different website!
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Hi Experts,
I am filling a file content with Zero and renamed it and Delete it.
but when I rename the file and try to delete it, file file's lost contents are come back.
If I do not Rename the file everything is fine.
Its like
1.Fill content with Zero
2. szString=RenameFile(szString)
3. DeleteFile(szString);
But I put a Sleep(2000) in between 2 and 3 It works well but get slow.
Is there any workaround?
Thank You.
|
|
|
|
|
pther wrote: Fill content with Zero
You have to close the file handle first!
pther wrote: 2. szString=RenameFile(szString)
3. DeleteFile(szString);
CopyFile("Src.txt", "Dest.txt", FALSE);
DeleteFile("Src.txt");
Or
rename("Src.txt", "Dest.txt");
Maxwell Chen
|
|
|
|