# HINSTANCE

```csharp
[DebuggerDisplay("{Value}")]
public readonly struct HINSTANCE : IEquatable<HINSTANCE>
{
    public readonly IntPtr Value;

    public HINSTANCE(IntPtr value) => Value = value;

    public static HINSTANCE Null => default;

    public bool IsNull => Value == default;

    public static implicit operator IntPtr(HINSTANCE value) => value.Value;

    public static explicit operator HINSTANCE(IntPtr value) => new(value);

    public static bool operator ==(HINSTANCE left, HINSTANCE right) => left.Value == right.Value;

    public static bool operator !=(HINSTANCE left, HINSTANCE right) => !(left == right);

    public bool Equals(HINSTANCE other) => Value == other.Value;

    public override bool Equals(object obj) => obj is HINSTANCE other && Equals(other);

    public override int GetHashCode() => Value.GetHashCode();

    public override string ToString() => $"0x{Value:x}";

    public static implicit operator HMODULE(HINSTANCE value) => new(value.Value);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pinvoke.dev/foundation/hinstance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
