ImageGear for C and C++ on Windows v19.9 - Updated
IG_GUI_page_active_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > GUI Functions > GUI Page Functions > IG_GUI_page_active_get

This function returns the page number of the currently "active" image in the GUI Page Sorter window.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_GUI_page_active_get(
        HWND hwndPage, 
        LPUINT lpPageNumber
);

Arguments:

Name Type Description
hwndPage HWND Windows handle to the GUI Page Sorter window.
lpPageNumber LPUINT A far pointer that returns the page number of the "active page."

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

This function does not process image pixels.

Sample:

Page

Example:

 
Copy Code
/* This excerpt from the Page.c sample checks to see if there are any pages in the GUI
Window Sorter. If not, the file being opened is made the "current page" (nCurrentPage) and
page #1 is set to the active page. If there are already pages, nCurrentPage is set to the
active page */
HIGEAR hIGear;    /* HIGEAR handle of image  */
UINT nCurrentPage;/* page number of the active page */
HWND hwndPage;  /* Windows handle to the Page Sorter*/
/* set the initial page */
if (!nCurrentPage)
{
        nCurrentPage = 1;
        /* set the active page */
        IG_GUI_page_active_set(hwndPage, nCurrentPage);
}
else
{
        /* get the new page */
        IG_GUI_page_active_get(hwndPage, &nCurrentPage);
        IG_GUI_page_handle_get(hwndPage, nCurrentPage, 
                &hIGear);
}

Remarks:

The active image has a selection border around it. This function is a companion to IG_GUI_page_focus_set() and IG_GUI_page_active_set() in that it returns the page number of the image on which the "focus" is set.