Snoby
12-12-2006, 08:36 PM
I am developing a mobilitycenter application , basically doing customization
by adding new tiles on Windows Mobility Center .
I created new Tiles and in one of the Tile I want to show the status of
WWAN,WLAN,Bluetooth devices on or off.
Basically I will get all the status details from another application .I am
taking all the stautus from that application by using CreateProcess .
But it is taking time , so I made a background thread to retrieve all the
status from an application by making createprocess in one thread for to avoid
delay in showing my tiles.
The thread will execute only once that when the MobilityCenter open at first
time.
My thread start from inside GetStatusText(..) function of Mobility center
(Even I tried with starting my thread from FinalConstruct () also. I will
start my thread here after that I soon return with a status text showing
"Processing..."
My thread start running in background to get the actuaul status from the
application.
when my thread will return the correct status from CreateProcess and check ,
I am making a call of MobilityCenterRefresh(l "TileName") .
But my problem is , When I open Mobilitycenter first time after my restart
of the system , it's stopping by showing status " Processing".
NB : When the second time Refresh happens from thread it will not call
again the thread from GetstatusText. It will .check the status of the device
and return text with On/off. only
I checked by putting log writing to notepad and checked y thread and all are
executing , but the MobilityCenterRefresh() API is not refreshing the tile .
If I put Sleep(1000) before MobilityCenterRefresh() API that I am using
inside thread for to refresh with original status it will work without any
problem even I restart the system and open first time also...
But I think Sleep() is not a right solution for this....I think it's problem
of API ....Kindly clarify on this issue for me.....
Please suggest me a solution on this...or it's the problem with API...or Is
it possible to try out with another ways....clarify..
by adding new tiles on Windows Mobility Center .
I created new Tiles and in one of the Tile I want to show the status of
WWAN,WLAN,Bluetooth devices on or off.
Basically I will get all the status details from another application .I am
taking all the stautus from that application by using CreateProcess .
But it is taking time , so I made a background thread to retrieve all the
status from an application by making createprocess in one thread for to avoid
delay in showing my tiles.
The thread will execute only once that when the MobilityCenter open at first
time.
My thread start from inside GetStatusText(..) function of Mobility center
(Even I tried with starting my thread from FinalConstruct () also. I will
start my thread here after that I soon return with a status text showing
"Processing..."
My thread start running in background to get the actuaul status from the
application.
when my thread will return the correct status from CreateProcess and check ,
I am making a call of MobilityCenterRefresh(l "TileName") .
But my problem is , When I open Mobilitycenter first time after my restart
of the system , it's stopping by showing status " Processing".
NB : When the second time Refresh happens from thread it will not call
again the thread from GetstatusText. It will .check the status of the device
and return text with On/off. only
I checked by putting log writing to notepad and checked y thread and all are
executing , but the MobilityCenterRefresh() API is not refreshing the tile .
If I put Sleep(1000) before MobilityCenterRefresh() API that I am using
inside thread for to refresh with original status it will work without any
problem even I restart the system and open first time also...
But I think Sleep() is not a right solution for this....I think it's problem
of API ....Kindly clarify on this issue for me.....
Please suggest me a solution on this...or it's the problem with API...or Is
it possible to try out with another ways....clarify..