|
I need to change the height of my CListCtrl when scrollbars are not present (horizontally). How can I , on the fly detect if the control has scrollbars or not? its columns keep changing so sometimes thee is a scrollbar, and sometimes not...
Thanks,
ns
|
|
|
|
|
One solution is to add messages handlers for both horizontal scroll bar and vertical scroll bar.
WM_HSCROLL - OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
WM_VSCROLL - OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
Kuphryn
|
|
|
|
|
Accumulate the width of each column. If the total exceeds the list control's client area's width, you've got scrollbars. Use GetColumn() to get the column widths and GetClientRect() to get the client rect.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks for the ideas....its a funny problem. When there are sbars, I've shrunk the control down so all you see are the headers and the scrollbar. When there arent enough columns populated, the sb vanishes, and the area it took up, is visible to the user because now the first row of the control shows. I have to make it somehow that it doesnt get this blank area...only the header should show.
|
|
|
|
|
Hmm, you could try using one of SPI_ constants (none seemed obvious) in GetSystemMetrics() to get the height of the list control's header control, and use this value to resize the control.
Alternatively, you could just hide the list control and show a dummy one (of fixed height) with the same columns.
But if you want my honest opinion the concept of a list control that changes its height seems suspect at first glance.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
This part is a real pain, I'm just tossing about ideas. It uses a CP class, and it does okay sort of but not really. Like I repopulate the ctrl each time with new headers and data (new # of columns) . Somethings going horribly wrong with my logic, and I'm staring at it.....aaargh!
Thanks for your ideas though. Soon as the functionality works, I'l apply the cosmetic part..
|
|
|
|
|
I have a demo project with several property pages in one
property sheet. To make a long story short, it's got a wicked
error. The computer just locks up after I click 7-8 property
pages. I have to reboot. I am absolutely stumped. Please,
can I email this demo project to someone who could look at it
and provide feedback? I am stumped beyond words.
Please, please, please, please, please, please, please, please.
My email address is brinasas@yahoo.com
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Are you running a debug build? If so, can you determine where the program locks up? It may be in an infinite loop. Also, what OS are you running?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I developed an ActiveX control in VC++. The control is very simple. It just fires two events simultaneously. I used in VC++ client. Whenever event is received, a message box is displayed. So my client application displays two message boxes immediately.
Now i want to use this control in Visual Basic. But i can only see one dialog box there despite two events are fired from control. I think when first message box is displayed the code is blocked and second message is discarded. Anyone having any idea about this problem, strange this problem is not in VC++ client ??
|
|
|
|
|
VB is single-threaded. Whereas your VC++ client is probably set to the default, multi-threaded setting. If you change your VC++ project setting to single-threaded, you probably will experience the same behavior as the VB client.
VB message boxes are modal and will starve out the single-threaded application message pump until they are closed.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Hai Friends,
Can anyone help me to go to a particular topic in a help file when F1 is pressed.
|
|
|
|
|
|
I am currently writing a program which is ported from C++ for DOS. I have a routine which handles the output messages to the screen in DOS, but now I am trying to output it to a ListBox in a Dialog box. Here a fragment of the code i have written..
#include "stdafx.h"
void utility::message()
{
SendMessage(0,WM_MYCALL,0,0);
}
WM_MYCALL is a handler I defined in a dialog class.
Apparently, when I tried this command, nothing really happen. My program is a SDI program. Somehow, WM_MYCALL is not process at all by the dialog class? Why does this happen? Is there something I missed out?
|
|
|
|
|
You must tell it where to send the message. Somehow I dubt you have a dialog box with a HWND of zero.
|
|
|
|
|
Yup, that's right. But I am not sure how to get the handle for my dialog box. Do you have any suggestion? So right now I am sending to the main window.
|
|
|
|
|
mydlg.GetSafeHwnd()
Pavel
Sonork 100.15206
|
|
|
|
|
If you have a dialog, surely you must know its HWND?
For every message your dialogs message-pump handles, you get a HWND as part of the MSG (so if you handle WM_INITDIALOG, the WPARAM is the HWND of the dialog).
|
|
|
|
|
Thanks for the information. I have tried to use GetSafeHwnd() instead, and pass it to the a global variable type of HWND. It works for now.
|
|
|
|
|
Hi everybody!
Does anyone know how to easily attach my own build routine to MSVS?
Consider I have a makefile for external compiler/linker (Watcom C++ 11.0).
Where should I place command "wmake.exe" (or a batch file that starts external compiler) to make all the stuff work?
Thanks.
|
|
|
|
|
Open that make file in MS VC IDE. Then complie it. It will automatically create the work space from the make file.
|
|
|
|
|
When i should go for static_cast and when should i use reinterpret_cast
|
|
|
|
|
try this:
http://msdn.microsoft.com/library/en-us/dndeepc/html/deep05182000.asp
|
|
|
|
|
|
Hi all,
How can one programatically, preferably WinAPI function, delete files regardless if Windows want you to or not?
For example, in "Temporary Internet Files" , Windows won't allow me to delete the index.dat file even after I close IE and all other programs. The error I get is the file is either protected or in use.
This is the function I used to try to delete it:
DeleteFile((LPCTSTR)m_szFile);
Thanks in advance.
Soliant | email
"During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software.
" - Alex E.
|
|
|
|
|