|
Hi all,
I need to write a piece of code to check if a particular shortcut is on the desktop. If anyone knows about it, please let me know.
Thanks a bunch.
|
|
|
|
|
The file is called *shortcutname*.lnk. So just check that's on the desktop, if you just want to know it's there.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
What is the best component out there for generating thumbnails for PPT slides? I've tried Aspose... memory issues.
|
|
|
|
|
How to implement following C code in c#?
sprintf( strBuf, "0x%02x", 1 ); // then the strBuf will be "0x01" rather than "0x1"
in C# how can I specify string.Format( "0x{0}", 1 ) to generate 0x01, rather than 0x1?
thanks
|
|
|
|
|
string.Format( "0x{0:X2}", 1 );
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
I've been doing some investigation to try to see how to avoid my IE web browser control from showing the layout while a page is downloading, so that it waits until DocumentComplete before displaying the page.
I've noticed that in C++ world, there's a flag DLCTL_SILENT that can be set on the pvarResult in IDispatch::Invoke. This flag says "No user interface will be displayed during downloads." Needless to say, this caught my attention. (If someone out there knows offhand that this is in fact *not* doing what I hope it's doing, please chime in.)
My problem now is that I can't figure out how to properly implement this in my C# application. Any ideas?
Thanks.
David
|
|
|
|
|
u can't use SuspendLayout()?
|
|
|
|
|
No, this is deep in the bowels of IE and interop. SuspendLayout() is for adding widgets to an existing control. I'm talking about actually stopping IE from dynamically showing HTML, images, etc. while it's in the process of loading it over the net. (And I'm making the assumption that this silent flag is the way to do it, which may be wrong anyway.)
This is more of a question about a) the IE SDK, and more importantly b) how to correctly use COM and interop to set the DLCTL_SILENT flag on IE from C#. In C++, it's just a matter of calling IDispatch::Invoke. But my experience with interop is limited, so I'm at a momentary standstill trying to do the equivalent Invoke operation in C#.
|
|
|
|
|
Hi,
Can anybody tell me what the difference is between an Abstract class and an interface? I believe that both dont have any implementation and you inherit them with the following syntax: MyClass: BaseClass , correct?
Thanks,
JJ
|
|
|
|
|
Abstract classes may include some implementation and some abstract members. Interfaces may include no implementation.
Neither may be directly instantiated.
The potential benefit of abstract classes is that you get the advantages of base implementation where you want it, and enforced subclass implementation where it's needed.
There is clear documentation of abstract classes and interfaces on MSDN[^].
Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
The basic difference between an Abstract class and an interface is that Abstract class allows Concrete method(methods that have implementation) but interface doesn't. The second difference is in terms of inheritance. A class can inherit from only one class but can implement any number of interfaces. One more difference is that interface doesn't allow variables/constants to be declared but abstract class allows for declaration of variables and constants.
------------------------------------
To study, study and only to study
|
|
|
|
|
|
|
Can't be done through WMI.
Using the GetJob APi and getting the dmCopies field of the JOB_INFO_2.DEVMODE structure works 80% of the time but if the client is using Microsoft Word it misreports the number of copies. In that case only actually parsing the spool file to get the true copy count works.
|
|
|
|
|
|
hi all,
I want to backup database and restore database using C#..
can any body please help me to do it?
Thanks in advance..
|
|
|
|
|
First, what kind of database?
Second, local backup or remote backup?
Third, "describing" backup or pure content-backup?
Cheers
Sid
|
|
|
|
|
I am using SQL Server 2000 and I can access Network SQL Servers also..
So I want to get complete database backup and restore itself in SQL Server's databases in my network..
|
|
|
|
|
Hi,
can anybody tell me that how to find out the minimum and maximum value from the single dimention array?
i don't want to go with for -loop or do while logic becoz it's taking somuch time and it reduce the performance.
can anybody tell me that what is the direct way to find out min & max value from array?
any sample code available then give me.
|
|
|
|
|
Are you creating the array ? You could just keep track of the min and max as you add values to the array with a couple variables. Other than that, I believe you will have to do some kind of sort on the array.
|
|
|
|
|
it's not that difficult. If it's generic array, and you don't have any specific information about array (specific information would be e.g. "it's sorted array"), you have to go through whole array - that's common sense. You can optimize this stupid algorithm only if you know something more... As already suggested, you could keep a variable with maximal/minimal value. Or you can have sorted array. Or if you need better performance (e.g. it's BIG array - I can think of sizes 1000+ ) you may consider different structure than array - heap, tree etc. Or you can sort array once and then find min and max is easy and in O(1). It really depends on what is in array and how you use the array... without more information, answer is you can't do anything better then O(N) (meaning: check all N items in array).
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi,
Let me tell you whole information.I had taken generic array not sorted one and it's single dimentional array.I am storing the pixel value of the image(i.e. R,G,B) into that single dimentional array.I want to find out the Minimum and maximum value from the pixel.so now i think u got whole idea.
so now for getting excellent performance what is the best way?
I think now u r having whole information.
|
|
|
|
|
Since you are adding each value to the array yourself just check each value against a Min and Max variable before you enter it into the array. i.e.
if(CurrentValue < MinValue)
MinValue=CurrentValue;
else if(CurrentValue > MaxValue)
MaxValue=CurrentValue;
Array.Add(CurrentValue);
|
|
|
|
|
Hi,
yeh i had applied logic which you had suggested but here as i am first using math.min(,) method which for looping the color pixel ,it only gives me min. value of last two pixels ,not min. value of whole pixels.
here is the code,
for (int row = rect.Left; row < rect.Right; row++)
{
for (int col = rect.Top; col < rect.Bottom; col++)
{
// XmlElement nodeColorFG = xmlDoc.CreateElement("COLOR");
dropColors[k] = PixelInfo.getColor(row, col);
if (dropColors[k].R < MinRvalue)
{
Minmax.MinRvalue = dropColors[k].R;
}
else if (dropColors[k].R > MaxRvalue)
{
Minmax.MaxRvalue = dropColors[k].R;
}
//RAvg+= dropColors[k].R / TotalPixels;
//Getting the Minimum & Maximum value of the Red (R) colors.
if (k!=0)
{
MinRvalue = Math.Min(dropColors[k-1].R, dropColors[k].R);
MaxRvalue = Math.Max(dropColors[k - 1].R, dropColors[k].R);
}
//Getting the Minimum & Maximum value of the Green (G) colors.
//GAvg += dropColors[k].G / TotalPixels;
BAvg += dropColors[k].B / TotalPixels;
k++;
//if (dropColors[k - 1].R > dropColors[k].R) Minmax.MinRvalue = dropColors[k].R;
}
}
so can you suggest me some more changes to get min. and maxi. value of whole pixels?pls.
|
|
|
|
|
Ok, I'm not sure what your variable Minmax is, but here is a possible solution to your problem...
for (int row = rect.Left; row < rect.Right; row++)
{
for (int col = rect.Top; col < rect.Bottom; col++)
{
dropColors[k] = PixelInfo.getColor(row, col);
Minmax.MinRvalue = Math.Min(Minmax.MinRvalue,dropColors[k].R);
Minmax.MaxRvalue = Math.Max(Minmax.MaxRvalue,dropColors[k].R);
Minmax.MinGvalue = Math.Min(Minmax.MinGvalue,dropColors[k].G);
Minmax.MaxGvalue = Math.Max(Minmax.MaxGvalue,dropColors[k].G);
Minmax.MinBvalue = Math.Min(Minmax.MinBvalue,dropColors[k].B);
Minmax.MaxBvalue = Math.Max(Minmax.MaxBvalue,dropColors[k].B);
BAvg += dropColors[k].B / TotalPixels;
k++;
}
}
if (k!=0)
{
MinRvalue = Minmax.MinRvalue;
MaxRvalue = Minmax.MaxRvalue;
}
|
|
|
|