I am trying to convert an array of the RECT structure (given below) into an IntPtr, so I can send the pointer using PostMessage to another application.
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
// lots of functions snipped here
}
...
I tied SHGetFileInfo and ExtractIconEx, both return a normal 32x32 icon and 16x16 with only 16 colors, and it looks awful. How do I extract a full color icon?
My code
SHFILEINFO shinfo = new SHFILEINFO();
IntPtr hImgSmall = SHGetFileInfo(fileName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), SHGFI_ICON | SHGFI_SMALLICON);
Icon icon = ...
I have some code which handles data files and reports an error when it runs into trouble, but I'm having trouble working out how to give my class a callback function. Here's a quick example of the sort of thing I'm trying to achieve:
public delegate void Reporter( System::String^ stringToReport );
/// <summary>
/// Simple file handler ...
Hello.
I have a winforms datagridview that seems to always have at least one row selected all the time. I'm not interested in being able to select the rows at all really, I just need the user to be able to select the checkbox in column 1.
Any ideas why there is always at least 1 row selected?
How can i prevent this?
Will it affect the ab...
Is it possible to determine when window focus changes at the system level? I'm writing a time-tracking application, and I'd like to be able to listen for application switching (so that I can begin logging time in a given application). I've poked around the Process class for a good hour here, and while I learned quite a few useful things,...
I've got some network code to process an arbitary TCP connection.
It all seems to work as expected but seems slow. When i've profiled the code the it seems to spend a good 600 ms in NetworkStream.Read() and I'm wondering how to improve it. I've fiddled with the buffer sizes and alternated between a massive buffer to read all of the dat...
Hi There,
I am wanting to find out if it is possible to easily debug a private access field in an object?
Here is a scenario for example sake: An application is running a WebBrowser class that is accessed privately from a class.
Is it possible to stop the application, change the Html of a page and continue the application?
Thanks,
K...
I want to make sure the first 4 letters in a eight character code is a letter. Is there a function for that, or do I have to make my own.
...
Does anybody know if you can access the SaevFileDialog control that's used by the WebBrowser control? Once somebody saves the webpage being displayed I need to catch where the files have been created; however I can't seem to find any events/members that allow me access to that information.
...
If you have a string of "1,2,3,1,5,7" you can put this in an array or hash table or whatever is deemed best.
How do you determine that all value are the same? In the above example it would fail but if you had "1,1,1" that would be true.
...
I have the exact same question as this one:
http://stackoverflow.com/questions/831519/aggregate-functions-in-ado-net-with-group-by-functionality/1084230
however the proposed solution was for .net 3.5 but I am using .Net 2.0 so I cant the LINQ query. To summarize: I have a DataSet and I want to create a view from it and apply something s...
I have 3 tables that link up. Restaurants, Cuisines and Cuisine Type.
A Restaurant can sell many cuisines of food (that's bad wording but you get idea?)
So I have Full text setup on Restaurant:Name, CityTown, Postcode and on CuisineType:Name
I have one searchbox on my home page and as the user types results are filtered to best match....
I have a small job that takes a text file of email/zip codes and inserts them into a sql server 2005 table. It reads each line of the source file, checks to make sure that it parses into a valid email address/zip code, creates a sql insert command, adds it to a string builder and eventually executes it. I want to do a single execute inst...
Possible Duplicate:
Custom Compiler Warnings
Duplicate: http://stackoverflow.com/questions/154109/custom-compiler-warnings/154254
I'm new to writing my own Attributes for .NET, but would like to write one that behaves similarly to the System.ObsoleteAttribute attribute--if a class/member is tagged with the attribute I would...
I have a list of string values that I want add to a hashtable or other array that can be accessed by key/index but cannot implement it. I have this working how I want but its ugly
List<string> valueList = new List<string>();
valueList.Add("1");
valueList.Add("2");
valueList.Add("3");
Hashtable p ...
I am writing a configuration system in which the app.config file is dynamically constructed from various config fragments distributed across multiple locations. The system currently works as follows:
Bootstrapper builds configuration file.
Bootstrapper initializes new AppDomain with new config file as the configuration file.
As a resul...
I use this to mark code I need to come back to:
#warning Do more stuff here
However, sometimes these warning don't show up in the Error List window after a build. I can see the warnings in the compiler output window, but only some of them make it into the Error List. If I have the code file open that has these warnings they are always...
I would like to be able to create a runtime proxy for a POCO, in the same style as I might in Java using the JRE or cglib proxying libraries.
I've seen Castle DynamicProxy which looks like it fits the bill, but the documentation isn't great. I'm also surprised that this kind of thing isn't in the .Net Framework itself.
Does anyone:
K...
We have a very large project mostly written in C# that has some small, but important, components written in C++. We target the RTM of .NET 2.0 as the minimum required version. So far, in order to meet this requirement we've made sure to have only the RTM of .NET 2.0 on our build box so that the C++ pieces link against that version.
Upda...
I have a .NET CF library that produces PCM formatted data stream (as Stream object) from an MP3 file. I want to make my Windows Mobile phone to play the podcast I decode with that library. How can I play the PCM stream? I have tried PlaySound pinvoke stuff but does not work. It expects the entire song to be in memory as a WAVE file, whic...