Click here to Skip to main content
15,905,776 members
Home / Discussions / C#
   

C#

 
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.

QuestionButton.Click Error "Page Cannot Be Displayed" Pin
amdacc12-Nov-07 1:08
amdacc12-Nov-07 1:08 
QuestionMessagebox details Pin
Scalee11-Nov-07 23:50
Scalee11-Nov-07 23:50 
AnswerRe: Messagebox details Pin
Pete O'Hanlon11-Nov-07 23:51
mvePete O'Hanlon11-Nov-07 23:51 
AnswerRe: Messagebox details Pin
Christian Graus11-Nov-07 23:52
protectorChristian Graus11-Nov-07 23:52 
QuestionPrintPreviewControl - Document does not contain any pages Pin
Stevo Z11-Nov-07 23:42
Stevo Z11-Nov-07 23:42 
AnswerRe: PrintPreviewControl - Document does not contain any pages Pin
Stevo Z12-Nov-07 1:24
Stevo Z12-Nov-07 1:24 
QuestionLearning Mobile Application in C#.net Pin
sindhutiwari11-Nov-07 23:35
sindhutiwari11-Nov-07 23:35 
AnswerRe: Learning Mobile Application in C#.net Pin
Justin Perez12-Nov-07 2:27
Justin Perez12-Nov-07 2:27 
GeneralRe: Learning Mobile Application in C#.net Pin
sindhutiwari12-Nov-07 5:49
sindhutiwari12-Nov-07 5:49 
GeneralRe: Learning Mobile Application in C#.net Pin
Justin Perez12-Nov-07 5:53
Justin Perez12-Nov-07 5:53 
GeneralRe: Learning Mobile Application in C#.net Pin
darkelv12-Nov-07 13:13
darkelv12-Nov-07 13:13 
QuestionHow to set focus on Form when its visible ? Pin
Yanshof11-Nov-07 23:30
Yanshof11-Nov-07 23:30 
GeneralRe: How to set focus on Form when its visible ? Pin
Yanshof12-Nov-07 3:32
Yanshof12-Nov-07 3:32 
QuestionHow to scale resize form/controll according to mobile(product) in Mobile Applications Pin
pashitech11-Nov-07 23:11
pashitech11-Nov-07 23:11 
QuestionColoring issue Pin
Muammar©11-Nov-07 23:03
Muammar©11-Nov-07 23:03 
AnswerRe: Coloring issue Pin
Rajasekharan Vengalil11-Nov-07 23:09
Rajasekharan Vengalil11-Nov-07 23:09 
GeneralRe: Coloring issue Pin
Muammar©12-Nov-07 0:16
Muammar©12-Nov-07 0:16 

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.