Skip to content

Commit

Permalink
Merge pull request #707 from dart-windows/706
Browse files Browse the repository at this point in the history
Add user32 APIs
  • Loading branch information
timsneath committed May 16, 2023
2 parents d471f12 + 3ffe9c6 commit c7f91fe
Show file tree
Hide file tree
Showing 10 changed files with 700 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.0.2

- Add some additional user32 exports (#706, thanks to @ilopX)

## 5.0.1

- Add `IWebAuthenticationCoreManagerInterop` (#702, thanks to @solbirn)
Expand Down
19 changes: 19 additions & 0 deletions lib/src/structs.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5022,6 +5022,25 @@ base class MEMORY_BASIC_INFORMATION extends Struct {
external int Type;
}

/// Contains menu bar information.
///
/// {@category Struct}
base class MENUBARINFO extends Struct {
@Uint32()
external int cbSize;

external RECT rcBar;

@IntPtr()
external int hMenu;

@IntPtr()
external int hwndMenu;

@Int32()
external int bitfield;
}

/// Contains information about a menu.
///
/// {@category Struct}
Expand Down
38 changes: 38 additions & 0 deletions lib/src/win32/gdi32.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,44 @@ final _CloseFigure =
_gdi32.lookupFunction<Int32 Function(IntPtr hdc), int Function(int hdc)>(
'CloseFigure');

/// The CreateBitmap function creates a bitmap with the specified width,
/// height, and color format (color planes and bits-per-pixel).
///
/// ```c
/// HBITMAP CreateBitmap(
/// [in] int nWidth,
/// [in] int nHeight,
/// [in] UINT nPlanes,
/// [in] UINT nBitCount,
/// [in] const VOID *lpBits
/// );
/// ```
/// {@category gdi32}
int CreateBitmap(
int nWidth, int nHeight, int nPlanes, int nBitCount, Pointer lpBits) =>
_CreateBitmap(nWidth, nHeight, nPlanes, nBitCount, lpBits);

final _CreateBitmap = _gdi32.lookupFunction<
IntPtr Function(Int32 nWidth, Int32 nHeight, Uint32 nPlanes,
Uint32 nBitCount, Pointer lpBits),
int Function(int nWidth, int nHeight, int nPlanes, int nBitCount,
Pointer lpBits)>('CreateBitmap');

/// The CreateBitmapIndirect function creates a bitmap with the specified
/// width, height, and color format (color planes and bits-per-pixel).
///
/// ```c
/// HBITMAP CreateBitmapIndirect(
/// [in] const BITMAP *pbm
/// );
/// ```
/// {@category gdi32}
int CreateBitmapIndirect(Pointer<BITMAP> pbm) => _CreateBitmapIndirect(pbm);

final _CreateBitmapIndirect = _gdi32.lookupFunction<
IntPtr Function(Pointer<BITMAP> pbm),
int Function(Pointer<BITMAP> pbm)>('CreateBitmapIndirect');

/// The CreateCompatibleBitmap function creates a bitmap compatible with the
/// device that is associated with the specified device context.
///
Expand Down
Loading

0 comments on commit c7f91fe

Please sign in to comment.