ImageGear for C and C++ on Windows v20.3 - Updated
IG_GUI_window_create
API Reference Guide > Core Component API Reference > Core Component Functions Reference > GUI Functions > GUI Window Functions > IG_GUI_window_create

This function is called to create a GUI window.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_GUI_window_create ( 
        HIGEAR hIGear, 
        DWORD dwGrpID, 
        HWND hWndParent, 
        const LPSTR lpszTitle, 
        INT nX, 
        INT nY, 
        INT nWidth, 
        INT nHeight, 
        HWND FAR* lphWndImage 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of an image.
dwGrpId DWORD Display group identifier, which is used to display an image in the GUI window.
hWndParent HWND Handle of the Parent window.
lpszTitle const LPSTR Title of an Image Window.
nX INT X position of the Image window's upper left corner.
nY INT Y position of the Image window's upper left corner.
nWidth INT Width of the Image window.
nHeight INT Height of the Image window.
lphWndImage HWND FAR* Far pointer to the HWND object to hold the Image window handle.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

GUI Windows, Display

Example:

 
Copy Code
LPFNIG_GUIWINDESTROY  MyGUIwinCleanup; /* Called when GUI window closed */
HWND    hWnd;          /* Handle of existing parent window     */
HWND     hWndImage;    /* Will hold handle of GUI window        */
BOOL     bDelete;     /* TRUE= delete HIGEAR image when close window  */
AT_ERRCOUNT nErrcount;    /* Returned count of errors      */
/* Create a GUI image window: */
nErrcount = IG_GUI_window_create ( hIGear, IG_GRP_DEFAULT, hWnd, "My GUI Image Window",
100, 50, 400, 200, &hWndImage );
If ( nErrcount == 0)
        {
/* Register a function to be called if user closes this GUI window:  */
        bDelete = FALSE;    /* (Don't delete HIGEAR if window is closed)*/
        IG_GUI_window_CB_register ( hWndImage, MyGUIwinCleanup, (LPVOID) &bDelete );
         ...
        }
/* Callback function, called when window is destroyed: */
VOID ACCUAPI  MyGUIwinCleanup
( LPVOID lpPrivate, HIGEAR hIGear, HWND hWndClosing )
{
/* Delete the image if bDelete not FALSE: */
if ( *((LPBOOL) lpPrivate) )
        {
        if ( IG_image_is_valid (hIGear) )
 { IG_image_delete ( hIGear ); }
        }
return;
}

Remarks:

See the description of the IG_GUI_window_associate() function.

 Currently it is possible to change font title for Page windows that is created by IG_GUI_page_window_create(). To set the font use IG_GUI_page_attribute_set() and to get the font use IG_GUI_page_attribute_get() with IG_GUI_PAGE_FONT_TITLE option. As in the case of thumbnail window, the user is responsible for creating and deleting font.
Is this page helpful?
Yes No
Thanks for your feedback.