|
nuclph wrote: I am sure it must be easy way to do it
The easy way is to use a different control. Think about it - what would it mean to word-wrap in a list - is the wrapped text the same or different items than the first bit of the line?
For what you're doing, I'd use a rich edit control, a) so I could specify a monospaced font like courier easily, and b) it's got this[^] useful method.
|
|
|
|
|
Stuart is quite right - a multiline list control would be odd.
You could implement an owner draw one, and make each entry take two lines, with some sort of visual cue - but that would be hard work - and a waste if you commonly have a small amount of text for each entry.
Alternately, you could use a tooltip for your CListBox.
Read:
http://msdn.microsoft.com/en-us/magazine/dvdarchive/cc301416.aspx[^]
and then go to
http://www.dilascia.com/PixieDoc.htm#CListBoxTipHandler[^]
for code. All of Paul DiLascia's work is worth a look see. I learned loads from him when I started out.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Iain Clarke wrote: All of Paul DiLascia's work is worth a look see. I learned loads from him when I started out.
Indeed! I too learned truck loads from his articles. He died the night of September 3rd, 2008[^].
|
|
|
|
|
Wow, that was news to me. I just assumed he'd made his piles from early microsoft shares (or from bribes to answer particular reader questions) and had retired to Tahiti.
As I was largely working alone, he and Matt Pietrek were my MFC teachers.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Dear All,
I want to add the special character "&" into my label box, but when I add this, it takes as "_". I know that putting "&" before a character makes the "_" as a shortcut for Alt key.
But I want to include "&" to be displayed in my label box. Is there any way for this ?
Thanks in advance.
Bhanu
|
|
|
|
|
Try with a double &, only one will be displayed.
|
|
|
|
|
Thank you for your kind help. It is working...
|
|
|
|
|
Hallo all,
I have used a List box control and it showing some files full path. I want to show this path one by one when it find out like "Searching in xp". But it display all path at a time. Can any one help me.
Thanks
Regards
saheen
|
|
|
|
|
Shaheen.India wrote: I have used a List box control and it showing some files full path. I want to show this path one by one when it find out like "Searching in xp". But it display all path at a time. Can any one help me.
Have you tried using DlgDirList[^]?
|
|
|
|
|
|
Do you mean that you run a loop looking for the files, when you find one you add the path to the list, but the list only gets redrawn once your loop is done thus all your hits appear at once? If so, you have 3 options i can think of right now:
1. do the search in a different thread and send/post your hits towards the GUI thread
2. do your search with a timer
3. do your search in idle-time (when your GUI thread has no messages to process)
p.s: You could also try simply forcing your list to be redrawn in your loop with e.g. using RedrawWindow, but that would be an ugly solution.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Thanks for your reply. Yes, I have used it in loop, that's why the problem arise
|
|
|
|
|
Another option you can do is within your loop, when you find a file you are most likely doing
m_ListBox->AddString(xxxx)
Immediately after you do the AddString, you can add
m_ListBox->UpdateWindow() and that will cause the list box to show the new data.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi,
I want to launch outlook using ShellExecuteEx and I am able to launch it. But I want to pass file (mydoc.doc) as a parameter to it. So that it will open an outlook evelop and attach this file to it.
SHELLEXECUTEINFO shExecInfo;
shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
shExecInfo.fMask = NULL;
shExecInfo.hwnd = NULL;
shExecInfo.lpVerb = NULL;
shExecInfo.lpFile = "OutLook";
shExecInfo.lpParameters = "C:\\test\\mydoc.doc";
shExecInfo.lpDirectory = NULL;
shExecInfo.nShow = SW_MAXIMIZE;
shExecInfo.hInstApp = NULL;
ShellExecuteEx(&shExecInfo);
Please let me know what wrong with this code.
Thanks
SNI
|
|
|
|
|
Does it work if you simply run outlook with a doc parameter from a console or using RUN in start menu? Maybe you need to specify other parameters to let Outlook know what you want it to do with that doc.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Thanks for reply. But I tried with other parameters but it is failing and giving following msg
"The command line argument is not valid. Verify the switch you are using." Is there any switch needs to be provided while specifying the file name.
SNI
|
|
|
|
|
Check out here[^], it says, the command line argument for attaching a file is /a <path to file>
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Hi,
I would like to make it so that when the cursor is over my window it has a custom look. How can I achieve this with win32?
Thanks,
Steve
|
|
|
|
|
One way is to handle the WM_SETCURSOR[^] message. A different way would be to specify your own cursor handle when registering a window class.[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
wibblewoo wrote: I would like to make it so that when the cursor is over my window it has a custom look. How can I achieve this with win32?
Using cursors![^]
|
|
|
|
|
Oh God I don't know how I didn't find that when I was looking.
Thanks.
|
|
|
|
|
wibblewoo wrote: Oh God I don't know how I didn't find that when I was looking.
MSDN has an interesting set of "Using xxxx" series. If interested type in "Using" into the index edit box and you'll see a bunch of articles.
|
|
|
|
|
As per google, MTU(Maximum transmission unit) can have maximum value of 1500 bytes but I am sending more then 1500 bytes data over socket from one application to other(on differnet m/c).It is going fine. I have tried up to 3500 bytes.
Please tell that what is the maximum size of MTU and how can I find out?
Thanks in advance.
Regards,
Vishal Soni
|
|
|
|
|
what's MTU ?
This signature was proudly tested on animals.
|
|
|
|
|
Maximum transmission unit
|
|
|
|