|
Hi all;)
I would like to know how can I make my listbox scroll down automatically when its items is page-full. I think GetScrollInfo, ScrollWindowEx is probably what I need. However, I don't know how to put them together to make an atuo-scroll listbox possible. Can anyone please give me some hints?
regards,
UWO
|
|
|
|
|
call this function when ever you add a list item
listObject.SendMessage(WM_VSCROLL, SB_LINEDOWN, 0);
|
|
|
|
|
Thanks for your quick answer! You are really helpful
regards,
UWO
|
|
|
|
|
If you are using MFC and your listbox is derived from CListCtl:
m_MyList.EnsureVisible( m_MyList.GetItemCount()-1, FALSE );
If using WIN32 inlude windowsx.h and use the following macros:
#include <windowsx.h>
...
ListBox_SetCurSel(hwndCtl, ListBox_GetCount(hwndCtl))
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Your solution just work perfect for me, Thanks!;)
regards,
UWO
|
|
|
|
|
Does UWO stand for University of Western Ontario?
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
no..It's my nickname only.
regards,
UWO
|
|
|
|
|
|
|
How to find item or string in ListCtrl
I am using finditem but it is searching in first column only.
|
|
|
|
|
|
I want to add XP look to my buttons and ListCtrl (Visual C++ 6.0).
I added manifest file in same folder of my exe file and that works with buttons and edit ctrl, but when I click on vertical scrollbar of my listctrl i get extra lines in ctrl (it is set that list ctrl has gridlines) or they wanish ?!
Does anyone knows how to solve this problem??
|
|
|
|
|
Hi guys,
Does anybody have an idea how I can get the type of
a class member variable ?
I'm looking for something like:
template<class c=""> swap(C &v)
{
typeof(v.x) t; //<-- t has to be the same type as v.x
t = v.x;
v.x = v.y;
v.y = t;
}
Thanks in advance.
|
|
|
|
|
You could use dynamic_cast and if the returned pointer is not NULL, it was a good cast.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Given that in this case all you want to do is swap the member, why not call swap on that? The nice part about this is that it requires at compile time that what you pass into swap_x_with_y has an x and y member variable. The realswap function will happily just swap over whatever you give it, providing they are the same type.
template<class T> swap_x_with_y(T &v)
{
realswap(v.x, v.y);
}
template<class T> realswap(T &x, T&y)
{
T t = x;
x = y;
y = t;
}
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
hello,im interested to know if there is a way to capture the output from a program like telnet or something and save it to a text file?
i see no reason why this isnt possible,so if any 1 has any info regarding this,id like to know...
thanks 4 ya time
chris
|
|
|
|
|
You may use pipes.
at the prompt type
dir *.* > directory.txt
you may also send the output to 2 devices.
Make a file with all the commands you want to carry out in telnet seperated by a newline.
Don't forget to include q a the end.
then save the file as telnet.cmd or something you will remember.
at the command prompt enter
telnet < telnet.cmd > telnet.res
That will work just fine.
The other way is to echo to a file but that is noit good practice any more because window may not support the src device anymore.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
thank's this will work just fine;)
|
|
|
|
|
Hello
Has the registry changed at anytime from win 95 to win XP concerning the following keys?
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\Software\Microsoft
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\Software\Microsoft\Outlook
Express
HKEY_CURRENT_USER\Identities\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}\Software\Microsoft\Outlook
Thanks Marty
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Yes it work fine, I think you are on to a better way.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Well, I looked around, and everyone seems to think this is hard to do, but here's what I came up with:
BOOL CD3PlayRecsDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CRect frameRect;
GetDlgItem(IDC_STATIC_VIEWFRAME)->GetWindowRect(&frameRect);
m_pView = new CDialogView(NULL);
ScreenToClient(&frameRect);
DWORD winStyle = WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE | WS_BORDER;
m_pView->Create(NULL, NULL, winStyle, frameRect, this, AFX_IDW_PANE_FIRST+1, NULL);
m_pView->SetScrollSizes(MM_TEXT, CSize(100,100));
m_pView->MoveWindow(&frameRect, TRUE);
return TRUE;
}
In the dialog tempate, I created a static frame to use as an anchor (where and how large I wanted the view window to be), and then created a CScrollView object and moved it into position. The tricky bit was getting it not to crash when the dialog box tried to display itself, but calling SetScrollSizes fixed that.
Am I missing something? Should this be hard to do than it appears to be?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Hi Jason
Try some ASSERTS
like
CHttpMyDlg* pDlg = ( CHttpMyDlg*) pParam;
ASSERT(pDlg);
ASSERT(pDlg->IsKindOf(RUNTIME_CLASS( CHttpMyDlg)));
Then take pDlg-> and set your rect and view.
When you get the error you may see your mistake. I looks good to me so I am just trying to give you another way to look at it.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
I don't understand what you're trying to do/say.
This is a dialog-based app, and the code I posted is in the OnInitDialog() function of the main dialog.
It works, and even under debug, there are no memory leaks or anything...
Why would I care what kind of dialog it is?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Do you know?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Do I know what?
It's a CDialog with a CScrollView embedded in it.
It doesn't crash. It doesn't leak. I can update the view object (drawing in it) without any problems.
What's to know?
If you're gonna make a point, then make it, but don't draw this out. I don't have the time to banter back and forth with pointless discussion. If I screwed something up, then by all means tell me what I did wrong. The whole reason I even posted this is because it was easier to do than the impressions I was getting by reading the articles.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|