|
how can I catch event of clicking on minimize button
|
|
|
|
|
Write a handler for CWnd::OnSysCommand() and handle the case where nID is SC_MINIMIZE . Be sure to call the base class CWnd::OnSysCommand() method for stuff you don't want to trap.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ok, so the obvious:
SetScrollPos()
doesn't seem to be working. Can anyone tell me how to auto-scroll down 1 line each time a new item is added that would be out of view?
Thx!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
One way is to SetCurSel to the last item in the list each time you add an item.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
SetCurSel is not a mamber of CListCtrl
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Whoops, I was thinking of CListBox.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Try m_list.EnsureVisible(m_list.GetItemCount()-1)
- Shog9 -
I'd show a smile but I'm too weak
I'd share with you, could I only speak
|
|
|
|
|
hi folks,
Does someone know how to read/write files summary properties in C||C++?
I mean the info we get by right clicking and selecting properties then summary...
I tried getting that from the net and msdn without luck.
Any info greatly appreciated,
Remy
|
|
|
|
|
These should get you started:
SHGetFileInfo()
CFile::GetStatus()
GetFileAttributes()
GetFileTime()
|
|
|
|
|
Thanks David for your fast reply.
But i still didnt find how to do the trick.
Id like to store and retrieve information in the file and i thought i could do that directly.
if i go to the file properties, i see filds like description, origin, title subject content etc. Im trying to find a way to write on these fields.
Any idea?
|
|
|
|
|
One solution is SetFileAttributes().
Kuphryn
|
|
|
|
|
|
Is there a default color list for Windows application ?
For example, on the "Display Properties" under the Appearance, there's a small popup with 20 default colors; the same thing in Wordpad font dialog , but with a different UI.
Also in Word, there are 40 default colors in the nice popup window.
So, is there a default color list somewhere? not the UI, but the RGB values and names.
What can I search for in MSDN to find that out ?
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
There are enough similar controls here on cp.com
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I'm not looking for a UI, just the color list (RGB value and color names).
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
That's over 16.7 million colors. I don't think such a list exists! The one's that you do see have just chosen the more common colors to display.
|
|
|
|
|
I know that, I just wondering if there's a default SUBSET of 8, 16, or 32 basic colors (name vs. RGB) defined somewhere in the windows API ?
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Well, you could search all of the .H files for occurrences of RGB. That'll tell you for sure. Otherwise:
#define RED RGB(255,0,0)
#define WHITE RGB(0,0,0)
#define BLACK RGB(255,255,255)
#define GREEN RGB(0,255,0)
#define BLUE RGB(0,0,255)
#define PURPLE RGB(255,0,255)
#define LTBLUE RGB(0,255,255)
#define YELLOW RGB(255,255,0)
etc...
|
|
|
|
|
since there seems to be no default values, I will define them myself!
maybe not using #defines, but something similar
anyway!
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
This article colour picker cb[^] has a code listing of the common IE colours (about 128) with names and RGB values. You should be able to extract them and use those.
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
|
|
|
|
|
Does anyone know how to get the Display Name (e.g. "Microsoft Word Document") from a given extension (e.g. "doc").
I can't use ShGetFileInfo, because that requires a file you want information for. I won't have a file, just an extention.
Thanks!
|
|
|
|
|
Diarrhio wrote:
I can't use ShGetFileInfo
Sure you can - just use the SHGFI_USEFILEATTRIBUTES flag & the filename can be bogus.
- Shog9 -
I'd show a smile but I'm too weak
I'd share with you, could I only speak
|
|
|
|
|
|
Did you not read all of the documentation? It states:
If the uFlags parameter includes the SHGFI_USEFILEATTRIBUTES flag, this parameter does not have to be a valid file name. The function proceeds as if the file exists with the specified name and with the file attributes passed in the dwFileAttributes parameter. This enables you to obtain information about a file type by passing just the extension for pszPath and passing FILE_ATTRIBUTE_NORMAL in dwFileAttributes.
That implies that this will work:
SHFILEINFO fi;
CString strExtension;
m_ebExtension.GetWindowText(strExtension);
if (SHGetFileInfo(strExtension, FILE_ATTRIBUTE_NORMAL, &fi, sizeof(fi), SHGFI_USEFILEATTRIBUTES | SHGFI_TYPENAME) != 0)
{
m_staticAssocApp.SetWindowText(fi.szTypeName);
}
If you still do not want to use SHGetFileInfo(), try this. It's from the top of my head so you may have to tweak it:
HKEY hKey;
CString strExtension;
TCHAR szValue[128];
LONG lSize;
m_ebExtension.GetWindowText(strExtension);
if (RegOpenKey(HKEY_CLASSES_ROOT, strExtension, &hKey) == ERROR_SUCCESS)
{
lSize = sizeof(szValue);
RegQueryValue(hKey, _T(""), szValue, &lSize);
RegCloseKey(hKey);
if (RegOpenKey(HKEY_CLASSES_ROOT, szValue, &hKey) == ERROR_SUCCESS)
{
lSize = sizeof(szValue);
RegQueryValue(hKey, _T(""), szValue, &lSize);
RegCloseKey(hKey);
m_staticAssocApp.SetWindowText(szValue);
}
}
|
|
|
|
|
Friends,
We use ADO with VC++ in order to deal with database servers. My question is related to recordset object. When we execute certain query of select statement, the recoredset object contains the resultant records. Now please tell me where these records are actually present by default whether client side or server side ?? What happens when we fetch next record from recordset object? I want all records to be present on my client machine so that when i fetch records, there'll be no need to consult back server...how can i do so ???
|
|
|
|