|
Chris Richardson wrote:
haven't tried it, but you can take a look at CListCtrl::ApproximateViewRect. In the event that this doesn't work, I think it should be possible just to use GetItemRect with LVSIL_BOUNDS, then take the height of the rectangle and multiply it by the number of items you have, and that will be the needed height.
Actually I tried this but I must have something still basically wrong:
<... do initialization ...>
CSize sz = m_list.ApproximateViewRect();
m_list.PostMessage(WM_SIZE, sz.cx, sz.cy);
This seems to have no effect.
I think I'm having a senior moment here...
|
|
|
|
|
That's not the correct way to size a window. Use this instead:
m_list.SetWindowPos( NULL, 0, 0, sz.cx, sz.cy, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE );
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
That's it!
I know about and use SetWindowPos() but I just couldn't think of it.
Thanks!
And here is my working implementation (if anybody wanted to see actual code):
CSize sz = m_list.ApproximateViewRect();
CRect itRect;
m_list.GetItemRect(0, &itRect, LVIR_BOUNDS);
int vOffset = itRect.Height() - 3;
m_list.SetWindowPos(NULL, 0, 0, sz.cx, sz.cy - vOffset,
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE);
|
|
|
|
|
Hi
I was wondering how to find out which nodes of the treeview (a treeview with checkboxes) have their checkboxes checked.
Thanks
Nitin
|
|
|
|
|
GetItemState() ?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
I want to find all files that DO NOT contain my string pattern. I am looking for files that don't contain the literal "copyright". I want to search recursively a folder (or better yet, do this in my Visual SourceSafe database).
I have VC++ and Visual Studio at my disposal, but I was unsuccessful at using the Regular Expressions setting on the search tool.
Thank you.
Johnny
|
|
|
|
|
If you already are getting the filenames themselves, then the hard part is done. I've not used the built in regular expressions, but I know there are public domain regular expression classes/libraries out there.
However, there is an even easier way. If you already have them available to you, can you just use strstr() and see if it passes or fails. If you are using CStrings, then I'm sure there is an equivalent method, like substring() or something of the sort.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
One solution is FindFile() and FindNextFile().
Kuphryn
|
|
|
|
|
There was no WinAPI forum, so I thought this was the closest fit for which forum this post should be applied.
I have written some very simple (non-overlapped) windows (NT/2K) serial port drivers. The definitions to be used for baud rates have two different values, CBR_56000 and CBR_57600 (in addition to the others).
I notice that using a terminal emulator to test (Hyperterminal) set at 57600, I can connect to it fine using CBR_56000, but not CBR_57600. This seems a little bizarre.
I'd appreciate it if anyone can explain this?
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
Is it me who's blind and retarded, or is it impossible to add resources to .NET projects (C# in this case) as you would in a C++/MFC project?
All I want to do is to add icons/images and have them compiled into the assembly...
Nevermind, I found some articles to read in MSDN.
--
"And God said, Let us make man in our image"
|
|
|
|
|
How can I read a default value (HKCR\http\shell\open\command)? I tried passing an empty strign with RegQueryValueEx but it didn't work!
Thanks!
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
DWORD dwStatus,dwcbData=4096,dwType; HKEY hKey;
BYTE buffer[4096];
dwStatus = RegOpenKeyEx(HKEY_CLASSES_ROOT,"http\\shell\\open\\command", 0, KEY_READ, &hKey);
RegQueryValueEx(hKey,"",0,&dwType,(LPBYTE) buffer,&dwcbData);
works nicely for me.
#include <beer.h>
|
|
|
|
|
How can I create a folder programmatically from my MFC 6 application?
Thanks so much,
n
|
|
|
|
|
With CreateDirectory , surprisingly enough
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Help for a newbie!
I'm debugging a console application. The app uses several cout
statements to display info in the output window. However, when
single stepping through the program the output window is not
updated as each cout is executed. The output window is updated
when the end of the program is reached. Is there a way to cause the output window to be updated as each cout is executed. Thanks.
|
|
|
|
|
cout<<endl should flush to the console.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hi folks,
I am currently facing the problem as specified in the topic question. All I need to do is logon to a remote machine in the LAN and start an executable. The catch is I cannot use sockets. CreateProcessWithLogonW allows me to logon to the domain on my own machine using a different user id and password but how to achieve the same on a remote machine. Is it possible? If yes, kindly guide me.
ciao
Aravindan Premkumar
|
|
|
|
|
Hello guys,
Where can I find a good implementation of IClassFactory2 , whitout using that DECLARE_CLASSFACTORY2(CMyLicense) macro, to perform licensing capabilities to my software?
Thanks in advance,
Raphael Amorim Dantas Leite
VC++, VB, Java, .NET and eMbedded Programmer
|
|
|
|
|
What's wrong with checking out the code which the macro expands to?
--
"And God said, Let us make man in our image"
|
|
|
|
|
hello,
I've developed a programm that write to a file(using CFile). Now if i run it on a machine withoud Visual C++ installed, the programm crashes... can anyone tell me why?
if checked all dependencies and none are missing(i think)...
thanks in advance
[]D [] []D []
|
|
|
|
|
How did you check the dependencies? Did you use run option on depends.exe?
|
|
|
|
|
Why not setup a remote debugging session?
Then you can trace through your code and see where/when/why it fails.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi
I was wondering if it was possible to create another window in addition to the main window that comes up. It will come up when a menuitem is clicked on the main window. I'm just wondering how I would write the int WINAPI WinMain and LRESULT CALLBACK WndProc when I already have them up because of the original window.
Thanks
Regards
Nitin
|
|
|
|