For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > March 2006 > MessageBox ontop problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MessageBox ontop problem
Aftab Alam

2006-03-20, 7:01 pm

Hi All,

I am working on Qtek8310, the problem I am facing is I call

int nResult = MessageBox(GetActiveWindow(), _T("Do this thing...?"),
_T("MyApp"), MB_YESNO|MB_ICONQUESTION|MB_TOPMOST);


from a simple exe which doenst have any window...

now when the messagebox is displayed the MessageBox is always ontop but the
problem is when I try to press yes or no with soft keys the application just
in background is operated instead of this MessageBox....
I have tried
some times when I press back key the MessageBox title becomes MyApp and then
I can press soft keys on my messagebox

I tried using
::keybd_event(VK_TBACK, 0, 0, 0);
::keybd_event(VK_TBACK, 0, KEYEVENTF_KEYUP, 0);

just before displaying message box but this doesnt work

please tell me some work around ?

regards
Aftab Alam


riki

2006-03-21, 3:57 am

Aftab Alam wrote:
> Hi All,
>
> I am working on Qtek8310, the problem I am facing is I call
>
> int nResult = MessageBox(GetActiveWindow(), _T("Do this thing...?"),
> _T("MyApp"), MB_YESNO|MB_ICONQUESTION|MB_TOPMOST);
>
>
> from a simple exe which doenst have any window...
>
> now when the messagebox is displayed the MessageBox is always ontop but the
> problem is when I try to press yes or no with soft keys the application just
> in background is operated instead of this MessageBox....
> I have tried
> some times when I press back key the MessageBox title becomes MyApp and then
> I can press soft keys on my messagebox
>
> I tried using
> ::keybd_event(VK_TBACK, 0, 0, 0);
> ::keybd_event(VK_TBACK, 0, KEYEVENTF_KEYUP, 0);
>
> just before displaying message box but this doesnt work
>
> please tell me some work around ?


try:
int nResult = MessageBox(0, _T("Do this thing...?"), _T("MyApp"),
MB_YESNO|MB_ICONQUESTION|MB_TOPMOST);

riki

----
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.-- Linus Torvalds (2003-09-28)
By Night:
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
Latest Betas have WM5 layout and speed dial support
Aftab Alam

2006-03-21, 7:58 am

Hi riki.

I tired this as well but doenst work,
more over in actual device the Message Box is accessable after pressing back
key but in enulator it is not even after pressing back key...

int WINAPI WinMain(

HINSTANCE hInstance,

HINSTANCE hPrevInstance,

LPWSTR lpCmdLine,

int nCmdShow

)

{

int nResult = MessageBox(0/*GetActiveWindow()*/, _T("Use App...?"),
_T("MyApp), MB_YESNO|MB_ICONQUESTION|MB_TOPMOST);

return 0;

}

this is the simple code that I am writing....

regards
Aftab Alam


"Aftab Alam" <REMaftab.aATjmobiles.comREMOVE> wrote in message
news:eXejUyCTGHA.3192@TK2MSFTNGP09.phx.gbl...
> Hi All,
>
> I am working on Qtek8310, the problem I am facing is I call
>
> int nResult = MessageBox(GetActiveWindow(), _T("Do this thing...?"),
> _T("MyApp"), MB_YESNO|MB_ICONQUESTION|MB_TOPMOST);
>
>
> from a simple exe which doenst have any window...
>
> now when the messagebox is displayed the MessageBox is always ontop but
> the problem is when I try to press yes or no with soft keys the
> application just in background is operated instead of this MessageBox....
> I have tried
> some times when I press back key the MessageBox title becomes MyApp and
> then I can press soft keys on my messagebox
>
> I tried using
> ::keybd_event(VK_TBACK, 0, 0, 0);
> ::keybd_event(VK_TBACK, 0, KEYEVENTF_KEYUP, 0);
>
> just before displaying message box but this doesnt work
>
> please tell me some work around ?
>
> regards
> Aftab Alam
>



Matt

2006-03-21, 10:09 pm

why not try this:

::MessageBox(::GetForeground(), _T("Use App....?"), _T("MyApp"),
MB_YESNO|MB_ICONQUESTION);

Matt

Aftab Alam

2006-03-28, 4:08 am

Tthanks for the answer Matt, it worked,
now the problem that I am facing is that after 10 seconds or less the
messagebox goes into background automatically and after that I can not find
that messsage box and my applciation gets stuck onto that...

regards
Aftab Alam,


"Aftab Alam" <REMaftab.aATjmobiles.comREMOVE> wrote in message
news:eXejUyCTGHA.3192@TK2MSFTNGP09.phx.gbl...
> Hi All,
>
> I am working on Qtek8310, the problem I am facing is I call
>
> int nResult = MessageBox(GetActiveWindow(), _T("Do this thing...?"),
> _T("MyApp"), MB_YESNO|MB_ICONQUESTION|MB_TOPMOST);
>
>
> from a simple exe which doenst have any window...
>
> now when the messagebox is displayed the MessageBox is always ontop but
> the problem is when I try to press yes or no with soft keys the
> application just in background is operated instead of this MessageBox....
> I have tried
> some times when I press back key the MessageBox title becomes MyApp and
> then I can press soft keys on my messagebox
>
> I tried using
> ::keybd_event(VK_TBACK, 0, 0, 0);
> ::keybd_event(VK_TBACK, 0, KEYEVENTF_KEYUP, 0);
>
> just before displaying message box but this doesnt work
>
> please tell me some work around ?
>
> regards
> Aftab Alam
>



Amanda Grace Rapsang \(MSFT\)

2006-03-29, 8:03 am

Try:
::MessageBox(::GetForegroundWindow(), _T("Use App....?"), _T("MyApp"),
MB_YESNO|MB_ICONQUESTION | MB_SETFOREGROUND);

Thanks,
Amanda.


--


This posting is provided "AS IS" with no warranties, and confers no rights.
"Matt" <zimmerma009@hotmail.com> wrote in message
news:1142957372.445116.71890@i40g2000cwc.googlegroups.com...
> why not try this:
>
> ::MessageBox(::GetForeground(), _T("Use App....?"), _T("MyApp"),
> MB_YESNO|MB_ICONQUESTION);
>
> Matt
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com