Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
AnswerRe: undo and redo realization Pin
leppie12-Nov-07 3:50
leppie12-Nov-07 3:50 
AnswerRe: undo and redo realization Pin
Russell Jones12-Nov-07 7:22
Russell Jones12-Nov-07 7:22 
QuestionC# - Accessing SMB shares Pin
wbjohnson12-Nov-07 3:25
wbjohnson12-Nov-07 3:25 
Questionmove to previous and next images Pin
cwah12-Nov-07 3:23
cwah12-Nov-07 3:23 
AnswerRe: move to previous and next images Pin
leppie12-Nov-07 3:49
leppie12-Nov-07 3:49 
Questionmove images Pin
cwah12-Nov-07 3:22
cwah12-Nov-07 3:22 
QuestionHow do i create a desktop application in c#.net on automobile industry? Pin
12nidhi12-Nov-07 3:13
12nidhi12-Nov-07 3:13 
AnswerRe: How do i create a desktop application in c#.net on automobile industry? Pin
Colin Angus Mackay12-Nov-07 3:39
Colin Angus Mackay12-Nov-07 3:39 
GeneralRe: How do i create a desktop application in c#.net on automobile industry? Pin
12nidhi12-Nov-07 6:15
12nidhi12-Nov-07 6:15 
GeneralRe: How do i create a desktop application in c#.net on automobile industry? Pin
Colin Angus Mackay12-Nov-07 6:56
Colin Angus Mackay12-Nov-07 6:56 
AnswerRe: How do i create a desktop application in c#.net on automobile industry? Pin
Pete O'Hanlon12-Nov-07 4:27
mvePete O'Hanlon12-Nov-07 4:27 
QuestionWhy does MemoryStream.Read() corrupt the byte array? Pin
szolDat12-Nov-07 3:10
szolDat12-Nov-07 3:10 
AnswerRe: Why does MemoryStream.Read() corrupt the byte array? Pin
Guffa12-Nov-07 3:18
Guffa12-Nov-07 3:18 
AnswerRe: Why does MemoryStream.Read() corrupt the byte array? Pin
szolDat12-Nov-07 3:49
szolDat12-Nov-07 3:49 
GeneralRe: Why does MemoryStream.Read() corrupt the byte array? Pin
leppie12-Nov-07 3:51
leppie12-Nov-07 3:51 
GeneralRe: Why does MemoryStream.Read() corrupt the byte array? Pin
szolDat12-Nov-07 4:32
szolDat12-Nov-07 4:32 
GeneralRe: Why does MemoryStream.Read() corrupt the byte array? Pin
Guffa12-Nov-07 6:50
Guffa12-Nov-07 6:50 
QuestionCreating Custom Control in C# Pin
Abhijit Jana12-Nov-07 2:45
professionalAbhijit Jana12-Nov-07 2:45 
AnswerRe: Creating Custom Control in C# Pin
Eduard Keilholz12-Nov-07 3:04
Eduard Keilholz12-Nov-07 3:04 
GeneralRe: Creating Custom Control in C# Pin
Abhijit Jana12-Nov-07 3:11
professionalAbhijit Jana12-Nov-07 3:11 
GeneralRe: Creating Custom Control in C# Pin
Abhijit Jana13-Nov-07 1:45
professionalAbhijit Jana13-Nov-07 1:45 
QuestionPowershell Pin
DocFirestorm12-Nov-07 2:13
DocFirestorm12-Nov-07 2:13 
Questionpixel to inches Pin
sindhutiwari12-Nov-07 1:44
sindhutiwari12-Nov-07 1:44 
QuestionC# and API's Pin
Illegal Operation12-Nov-07 1:12
Illegal Operation12-Nov-07 1:12 
AnswerRe: C# and API's Pin
Pete O'Hanlon12-Nov-07 1:52
mvePete O'Hanlon12-Nov-07 1:52 
You can use APIs in C# no problem. Suppose that you want to get the hotspot information out of an icon using the API, you would do this:
public class MySampleApiWrapper
{

  /// <summary>
  /// The structure of the Icon information.
  /// </summary>
  [StructLayout(LayoutKind.Sequential)]
  public struct ICONINFO
  {
      /// <summary>
      /// If true, then this struct defines an icon. If false, then it's a cursor.
      /// </summary>
      public bool bIcon;
      /// <summary>
      /// The X co-ordinate of the icon hotspot.
      /// </summary>
      public int xHotspot;
      /// <summary>
      /// The Y co-ordinate of the icon hotspot.
      /// </summary>
      public int yHotspot;
      /// <summary>
      /// Specifies the icons bitmap mask.
      /// </summary>
      public IntPtr hbmMask;
      /// <summary>
      /// Handle to the icon colour bitmap.
      /// </summary>
      public IntPtr hbmColour;
  }


  /// <summary>
  /// Get the icon information.
  /// </summary>
  /// <param name="hIcon">The handle to the icon.</param>
  /// <param name="piconinfo">The returned <see cref="ICONINFO"/> structure.</param>
  /// <returns>True if the call was successful, false otherwise.</returns>
  [DllImport("user32.dll", EntryPoint = "GetIconInfo")]
  public static extern bool GetIconInfo(IntPtr hIcon, out ICONINFO piconinfo);
}.
To get this information, you would use
 ICONINFO iconInfo = null;
if (GetIconInfo(icon.Handle, out iconInfo))
{
  Trace.WriteLine(iconInfo.xHotspot);
}
For details on some of the API calls and there signatures, you can use this[^] site.

Deja View - the feeling that you've seen this post before.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.