Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Setting up the screen resolution from within a Photon application on either QNX4 or QNX RTP
Ref. No. QNX.000009874
Category(ies) Development
Issue Is there a way to get the current screen resolution from within a Photon application?


Solution Use PhWindowQueryVisible() function with flag parameter set to Ph_QUERY_GRAPHICS.

ie: Determine the absolute coordinates of the current console:

PhRect_t extent;

if( PhWindowQueryVisible( Ph_QUERY_GRAPHICS, 0,
        input_group, &extent ) == 0 ) {
    printf( "Upper left: (%d,%d) Lower right: (%d,%d)n",
            extent.ul.x, extent.ul.y,
            extent.lr.x, extent.lr.y );
}

Note:  Due to the shelves in QNX RTP if you want the whole screen including the area taken up by the shelves you must use the Ph_QUERY_EXACT flag.