Get the specified resource image from the system (reproduced)

zhaozj2021-02-16  78

Some resources commonly used in Winuser.h, such as icons for dialogs, images on some buttons, etc.

The following is an ID of some OEM resource serial numbers and some standard ICON:

/ / -------------------------------------------------------------------------------------------- ---------------------------

// Oem Resource Ordinal Numbers

#define obm_old_close 32767

#define OBM_SIZE 32766

#define obm_old_uparrow 32765

#define OBM_OLD_DNARROW 32764

#define obm_old_rgarrow 32763

#define OBM_OLD_LFARROW 32762

#define OBM_BTSIZE 32761

#define OBM_CHECK 32760

#define obm_checkboxes 32759

#define obm_btncorners 32758

#define obm_old_reduce 32757

#define obm_old_zoom 32756

#define obm_old_restore 32755

#define obm_close 32754

#define obm_uparrow 32753

#define OBM_DNARROW 32752

#define obm_rgarrow 32751

#define OBM_LFARROW 32750

#define obm_reduce 32749

#define obm_zoom 32748

#define obm_restore 32747

#define obm_reduced 32746

#define obm_zoomd 32745

#define obm_restored 32744

#define obm_uparrowd 32743

#define obm_dnarrowd 32742

#define obm_rgarrowd 32741

#define OBM_LFARROWD 32740

#define OBM_Mnarrow 32739

#define OBM_COMBO 32738

#define obm_uparrowi 32737

#define obm_dnarrowi 32736

#define obm_rgarrowi 32735

#define OBM_LFARROWI 32734

// Standard icon IDS

#define IDi_Application MakeintResource (32512)

#define idi_hand makeintResource (32513)

#define IDi_question makeintResource (32514)

#define idi_exclamation makeintresource (32515)

#define idi_asterisk makeintResource (32516)

#define idi_winlogo makeintresource (32517)

We can get specified resource images from the system through loadbitmap: void __fastcall tMainform :: Button1click (Tobject * Sender)

{

For (int i = 0; i <30; i )

{

Hbitmap hbitmap = :: loadbitmap (NULL, MakeintResource (32734 i));

TIMAGE * IMG = New TIMAGE (THIS);

IMG-> Picture-> Bitmap-> Handle = HbitMap;

Canvas-> DRAW (9 i * 16, 9, IMG-> Picture-> Bitmap);

DELETE IMG;

DeleteObject (HbitMap);

}

For (int i = 0; i <5; i )

{

Hicon Hicon = :: Loadicon (NULL, MakeintResource (32512 i));

TIMAGE * IMG = New TIMAGE (THIS);

Img-> Picture-> icon-> Handle = HICON;

Canvas-> DRAW (10 i * 32, 50, IMG-> Picture-> icon);

DELETE IMG;

DeleteObject (HICON);

}

}

转载请注明原文地址:https://www.9cbs.com/read-15738.html

New Post(0)