|
Posted by roberto - torino on January 15, 2008, 4:30 am
Please log in for more thread options
Hello everybody ,
I am trying to develop an application for a WM6 device that needs to
notify the user with a dialog even when the Phone key lock is active.
The result I would like to get is similar to the behavior of the
native dialer in case of an incoming call : the softkeys labels change
and the incoming call dialog appears on top of everithing.
My application already works when the key lock is disabled , I mean
that I already created a dialog that does everything I need , except I
don't have a clue on how to show that in lock mode.
So far I tried the followinf in the OnInitDialog():
{
........
HWND hwnd = ::GetDesktopWindow();
::GetWindowRect(hwnd,&m_DesktopRect);// to restore the desktop window
position after dismissing the dialog
::SetWindowPos(hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_HIDEWINDOW);
......
}
this actually shows my dialog but :
1) the softkeys are not working
2) when I dismiss the dialog and I try to restore the Desktop position
doing ::SetWindowPos(hwnd,HWND_TOP,
0,0,m_DesktopRect.right,m_DesktopRect.bottom,SWP_SHOWWINDOW);
the device seems to hang up for a wile and the desktop window never
appears again ...
Thanks in advance to everybody that will spend 5 minutes giving me any
advice .
|
|
Posted by GG on January 15, 2008, 7:08 am
Please log in for more thread options
> Hello everybody ,
>
[CUT]
>
> So far I tried the followinf in the OnInitDialog():
> {
> ........
> HWND hwnd = ::GetDesktopWindow();
> ::GetWindowRect(hwnd,&m_DesktopRect);// to restore the desktop window
> position after dismissing the dialog
> ::SetWindowPos(hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_HIDEWINDOW);
> ......
> }
>
Ciao Roberto,
forget the desktop window. You must use the WS_EX_ABOVESTARTUP style; use
this code in WM_INITDIALOG handler:
DWORD dwexstyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);
dwexstyle |= WS_EX_ABOVESTARTUP;
::SetWindowLong(hWnd, GWL_EXSTYLE, dwexstyle);
HTH,
--
Giuseppe Govi
<>
syncdata it
|
|
Posted by roberto on January 15, 2008, 7:41 am
Please log in for more thread options >
> > Hello everybody ,
>
> [CUT]
>
> > So far I tried the followinf in the OnInitDialog():
> > {
> > ........
> > HWND hwnd = ::GetDesktopWindow();
> > ::GetWindowRect(hwnd,&m_DesktopRect);// to restore the desktop window
> > position after dismissing the dialog
> > ::SetWindowPos(hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_HIDEWINDOW);
> > ......
> > }
>
> Ciao Roberto,
>
> forget the desktop window. You must use the WS_EX_ABOVESTARTUP style; use
> this code in WM_INITDIALOG handler:
>
> DWORD dwexstyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);
> dwexstyle |= WS_EX_ABOVESTARTUP;
> ::SetWindowLong(hWnd, GWL_EXSTYLE, dwexstyle);
>
> HTH,
>
> --
> Giuseppe Govi
> <>
> syncdata it
Great ! It is working now ,
thanks a lot.
Roberto
|
|
Posted by roberto on January 22, 2008, 6:37 am
Please log in for more thread options >
>
>
>
> > > Hello everybody ,
>
> > [CUT]
>
> > > So far I tried the followinf in the OnInitDialog():
> > > {
> > > ........
> > > HWND hwnd = ::GetDesktopWindow();
> > > ::GetWindowRect(hwnd,&m_DesktopRect);// to restore the desktop window
> > > position after dismissing the dialog
> > > ::SetWindowPos(hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_HIDEWINDOW);
> > > ......
> > > }
>
> > Ciao Roberto,
>
> > forget the desktop window. You must use the WS_EX_ABOVESTARTUP style; use
> > this code in WM_INITDIALOG handler:
>
> > DWORD dwexstyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);
> > dwexstyle |= WS_EX_ABOVESTARTUP;
> > ::SetWindowLong(hWnd, GWL_EXSTYLE, dwexstyle);
>
> > HTH,
>
> > --
> > Giuseppe Govi
> > <>
> > syncdata it
>
> Great ! It is working now ,
>
> thanks a lot.
>
> Roberto
Hello again ,
As I said in my previous post WS_EX_ABOVESTARTUP works fine , but I
still have some problem in handling dialogs in lock mode.
My application creates the following : CMainFrame parent of CDialog1
that creates and is parent of CDialog2
the tree of them have the WS_EX_ABOVESTARTUP style set .
On a certain notification CDialog1 shows Cdialog2 that pops up
properly in lock mode also.
the problem is when, being in lock mode, I dismiss Cdialog2 and
Cdialog1 is in foreground, I do not manage to hide Cdialog1 and put
the Desktop back in foreground leaving my application running
minimized.
I tried several ways :
CDialog1->ShowWindow(SW_HIDE); // no effect at all
CMainFrame->ShowWindow(SW_HIDE); // dialog disappear but sofkeys are
not updated to "Unlock" and title
SetForegroundWindow(GetDesktopWindow()); // no result
Any ideas ?
thanks a lot ,
Roberto
|
| Similar Threads | Posted | | Num Lock | October 18, 2007, 12:05 pm |
| Num Lock | October 29, 2007, 11:17 am |
| How to lock phone... | August 24, 2005, 2:26 am |
| How to lock phone... | August 24, 2005, 5:25 am |
| How to lock phone... | August 24, 2005, 7:51 am |
| Help with Active sync4.1 & WM5.0 | December 14, 2005, 8:53 pm |
| Active x controls | June 21, 2006, 8:21 am |
| Lock for device | August 22, 2007, 4:59 am |
| Getting around PIN lock from an application | December 19, 2007, 4:31 pm |
| Active Sync packages | November 24, 2005, 1:34 pm |
|