|
Hello,
when you select more than one file in the windows-explorer you can show the properties by right-clicking and choosing the item "Properties" in the shell-menu.
I need to be able to do this within my application. I use the ShellExecuteEx-function to accomplish this task. But the problem is that i can only show the properties for the first selected file. I did a google-search and tried also msdn. Maybe someone has an idee.
Best regards
Tabor25
|
|
|
|
|
tabor25 wrote:
I use the ShellExecuteEx-function to accomplish this task.
What does this code look like?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hallo David,
the code looks like this:
CString file = "";
POSITION pos = m_fileList.GetFirstSelectedItemPosition();
if (pos) {
file = m_fileTree.GetPath() + m_fileList.GetItemText(m_fileList.GetNextSelectedItem(pos), 0) + '\0';
}
if (file.GetLength()) {
SHELLEXECUTEINFO a_stInfo;
memset( &a_stInfo, 0, sizeof( a_stInfo ) );
a_stInfo.cbSize = sizeof( a_stInfo );
a_stInfo.lpVerb = _T("properties");
a_stInfo.lpFile = _T(file);
a_stInfo.fMask = SEE_MASK_INVOKEIDLIST;
ShellExecuteEx( &a_stInfo );
}
The member lpFile of the structure seems to carry only one filename. I tried to separate all selected files by using semicolon or \0 but without success. So at the moment i will show only the properties of the first selected file.
Maybe you or someone else has an idea...
Best regards
Tabor25
|
|
|
|
|
tabor25 wrote:
Maybe you or someone else has an idea...
Try IShellFolder::GetAttributesOf() instead.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
In a report style CListCtrl with multiple columns, I have traced on many CListCtrl events that the iSubItem of many ListCtrl STRUCTS is always zero eventhough the current subitem selected is on the columns other than the 1st column... For example:
<br />
void CResultsFormView::OnLvnItemchangedMyList(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);<br />
NMLVCUSTOMDRAW* pn=(NMLVCUSTOMDRAW*)pNMHDR;<br />
NMITEMACTIVATE* nm=(NMITEMACTIVATE*)pNMHDR;<br />
LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR;<br />
<br />
int item=temp->iItem;<br />
int subitem=temp->iSubItem;<br />
<br />
<br />
}<br />
<br />
Any thoughts on this problem...
"mustang this is ghostrider, requesting flyby..."
|
|
|
|
|
Hello
You can not select other than the 1st columns item in ListCtrl. The selection is always on the first column or it can be the whole row if you specified an appropriate style. So, for item changed event (and for most list control events) the subitem member will be 0.
Andrew
|
|
|
|
|
hello,
how can one adjust the position of the console window (default),for every c++ program in MS-visual studio 2003 environment.could there be a code for it ;is there any property settings.
my aim is to set the position of the console window at a set position for every c++ project without having to go to the dos prompt and adjust it every time.
regards
pratap
|
|
|
|
|
There is a directx driver in the windows system.
Thanks!
|
|
|
|
|
Does anyone know how to write strings into VS_VERSION_INFO?
For example i would like to change the InternalName of an executeable?
Not just version number...
any help would be much appreciated
Mepho
|
|
|
|
|
//Here goes.. this only copies ver from a src to dst file..
char srcfile[255], dstfile[255];
void changeVersion()
{
DWORD *dummy;
char *verinfo;
HANDLE hResource;
LONG lParam=0 ;
int size=0;
dummy=new DWORD;
size=GetFileVersionInfoSize(srcfile,dummy);
verinfo=(char*) malloc (size);
GetFileVersionInfo(srcfile,NULL,size,verinfo);
hResource = BeginUpdateResource(dstfile, FALSE);
if (NULL != hResource)
{
if (UpdateResource(hResource,
RT_VERSION,
MAKEINTRESOURCE(VS_VERSION_INFO),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPVOID) verinfo,
size) != FALSE)
{
EndUpdateResource(hResource, FALSE);
}
}
}
//end code
regs
|
|
|
|
|
Anyone know a way without using another source file to copy from?
any help woule be appreciated
|
|
|
|
|
|
No you can not. It wouldn't work over a proxy.
There isn't much need to throw an exception. Between HRESULT and IErrorInfo, there isn't mich you can't do as long as you aren't married to doing something that looks exactly like an exception.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Need help with this
My app. draws a continous graph in a picture box using BitBlt() function..it behaves very much like an oscilloscope...now i want to add scrolling capability so that it:
1..scrolls automatically forward with the curve
2..also user can scroll it back and forth to view the part of curve drawn earlier
thanks
|
|
|
|
|
Search a little bit on this website, there are a lot of chart controls in the "miscellaneous controls" section.
Otherwise if you want some specific help on what you did, post specific question. Because honnestly by seing your questions, the more accurate response I can give you is: add a method to your chart that will allow the user to scroll the curve. I suppose this helped you a lot isn't it ?
|
|
|
|
|
Hi all,
What functions can help me to show desktop on a computer in a private network?
Cheers,
Thanks.
G.K.Z
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
Salam,
What is the difference between #define and const int. Whether const int was present in C. If not, why it was introduced in C++?
|
|
|
|
|
A #define is just a preprocessor directive. Before the compilation, every lines in the code that match the 'first part' of the define will be 'replaced' by the 'second part' of the define. Thus there is no variable at all that is used for the define.
This code:
#define FIVE 5<br />
<br />
int Test = FIVE;
is exactly the same as this line:
int Test = 5;
|
|
|
|
|
wasife wrote:
What is the difference between #define and const int
keep in mind that #define have never been const int . you can use such a preprocessor command to replace whatever you want in the code before compile time.
such statements are fully authorized :
#define ONE_FLOAT (2.3f)
#define MAX(x,y) ((x > y) ? x : y)
and to continue on what cedric said, as the preprocessor works befor the compilation, the compiler cannot make any check on a bad "const" use with a #define...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
Here are a the differences between the const variables and #define 's
The #define constant
<list> processed before compile time
ignores scoping rules (the preprocessor doens't know about scopes)
can be used in switch statements
very low type safety
const variable
<list> Processed at link time (or at runtime, i'm not sure)
Obeys scoping rules (the compiler knows about scopes)
Can't be used in switch statements, since these must have compile time constants and const variables are not compile time constants
Very high type safety
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
const variables can easily be optimized away during compilation. Otherwise they could not be used in switch statements.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
const variables can easily be optimized away during compilation. Otherwise they could not be used in switch statements.
They cannot if the variable is located in an other translation unit. If you follow the "no variables in headers" rule, these constants should be declared in only one translation unit, which makes them unavailable at compile time.
IMHO though, people should use enums for constant integral values instead of ints or define constants..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Does Visual C++ 6.0 can support Borland c++ libraries.
Can i use Borland C++ libraries in my MFC application
ditty grail
|
|
|
|
|
void u(const int* cip)
{
int i = *cip;
}
In the snippet above, the argument "const int* cip" is a pointer to const that is to say the thing this pointer pointed to can't be changed but the pointer can be changed right? But I don't understand why the line "int* ip2 = cip;" can't passed the compilation. Is it because after its execution the pointee can be changed through ip2?
...always look on the <blink>bright
side of life...
(Whistle)
|
|
|
|
|
The reason why the compiler complains is that you want to do an assignment where the original value loses qualifiers. If I remember correctly, you can do the following:
void u(const int* cip)
{
int** ppi = &cip;
(*(*ppi)) = 6;
(*(*ppi)) = 8;
}
This is one of the many reasons why pointer magic should be avoided as much as possible.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|