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
–
WeiBing Tong
Aquila Mining Systems Ltd.
1450 City Councillors, Suite 330
Montreal, QC
Canada H3A 2E6
Tel: (514) 874-9917 ext 239
Fax: (514) 874-4005
Email: wbtong@aquilamsl.com
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 );
}
What are differences between the above implementation and
PtWindowGetState( ABW_base )?
Regards
–
WeiBing Tong
Aquila Mining Systems Ltd.
1450 City Councillors, Suite 330
Montreal, QC
Canada H3A 2E6
Tel: (514) 874-9917 ext 239
Fax: (514) 874-4005
Email: wbtong@aquilamsl.com