Hi,
I attached a timer to getting windows state. It seems that
window state is always Ph_WM_STATE_ISFOCUS ( 8000)
when I iconified the window or bring it back, etc.
Where do I make wrong?
int
Active( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
/* eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
unsigned short *WindowState;
PtArg_t Args[1];
PtSetArg( &Args[0], Pt_ARG_WINDOW_STATE, &WindowState, 0 );
PtGetResources( ABW_base, 1, Args );
printf( “%x\n”, *WindowState );
if( *WindowState & Ph_WM_STATE_ISFOCUS )
printf( “Hi, I am in focus\n” );
return( Pt_CONTINUE );
}
Thanks