#1
|
|||
|
|||
![]()
Hi again, maybe NickNack is reading my post in this quite forum
![]() I have written a program using the game api skeletton which starts other mobile programs like the callendar or the claculator. Everything works fine. However on my PDA it is not possible to bring back my application after I closed the external application (windows mobile 6). Even within the taskmanager it is not possible to bring back my ppl.program to life. Here is the basic game skelleton. I have added some code from this forum to bring it back. However it does not work ![]() Can someone help to bring back the focus. Many thanks in advance. I know this is a beginners problem. Here is the basic code: ************************************************** ****** // Simple Game API demo written by Alain Deschenes (c) 2004 #include "GameAPI.ppl" #declareapi GetDesktopWindow apidll GetDesktopWindow 0 1 func mainproc(hWnd$, Msg$, wParam$, lParam$) ok$ = true; case (Msg$) WM_CLOSE: // Window is closed ShutGameAPI(hWnd$); WM_KEYDOWN: g_KeyEvent(wParam$, True); WM_KEYUP: g_KeyEvent(wParam$, False); end; return (ok$); end; func GameProc(hWnd$, Msg$, wParam$, lParam$) case (Msg$) WM_PAINT: g_clear(0); RenderSprites; WM_TIMER: if (g_key.vkA$) PostMessage(hWnd$, WM_CLOSE, 0, 0); end; if (g_key.vkUp$) minMate$ = GetDesktopWindow(); SetForegroundWindow(minMate$); end; end; return (true); end; func WinMain last_hwnd$=FindWindow({GAPIClass},"SCLPP"); if (last_hwnd$ <> NULL) SetForegroundWindow( last_hwnd$ ); return (false); end; // Create new form needed for the GameAPI. h$ = newform({GAPI}, {GAPIClass}, &mainproc); // Show the form on screen. ShowWindow(h$, SW_SHOW); // Activate FPS counter at the bottom of the screen. ShowFPS(true, G_RGB(255, 255, 255)); // Initialize the GameAPI in form h$ with no DrawProc. InitGameAPIEx(h$, &GameProc, 240, 400, false, 5, 60); return (true); end; ******************************************* |
#2
|
|||
|
|||
![]()
hi,
minimized windows don't get wm_keydown messages, because they don't have the focus (kinda logic ![]() here is a complete example, hope it is what you are looking for: PHP Code:
|
#3
|
|||
|
|||
![]()
Thanks Nicknack,
I appreciate your support within this forum. I tried your code on my HTC HD2 PDA but nothing really changed. If I start an other program and try to bring back this PPL program via Task Manager nothing happens. The PPL program is still running but could not be brought to front. As far as I remember this was not a problem in WM5. I developed a launcher which worked fine on WM5 but this program is worthless if it could not be reactivated after closing an other program. Bests Michael |
#4
|
|||
|
|||
![]()
have you already tried the other functions like g_suspend/g_resume or showwindow? occurs this strange behavior only with ppl or with other progs/games too?
|
#5
|
|||
|
|||
![]()
Thanks Nicknack,
I don't know whether this is a strange behavior. This happens only with programs using the gapi skelleton. Does anyone have a simple gapi code example which works fine under windows mobile version 6? There must be a way of bringing PPL.programs back to screen after a call cames in or an other win mobile program was terminated. With the above described code example the program is still there, however does not update the screen. The only way stoping it is to kill it in the task manager. Thanks Michael- |
#6
|
|||
|
|||
![]()
my code runs fine here on winmo 6 classic. how do you execute the code, with editor or as standalone executable? have you tried g_resume already?
|
#7
|
|||
|
|||
![]()
I start the program with the stand alone executable. I can't believe that you can bring it back to screen and properly working after you have started for example the calculator. If I do so by doubble clicking on the gapi program in the task manager nothing happens. It seems that gapi has the focus again, however it does not update the screen. The task manager is still visible. Thats the problem. The only chance to get out of this is to restart the task manager and kill the program.
I have not tried g_resume so far. Don't blame me but I don't know where to insert it in the above shown example. Can you give me a hint please? (I am a stupid beginner, you know. But I become better and better each day ![]() Cheers Michael |
#8
|
|||
|
|||
![]() PHP Code:
![]() I have included a color flashing so you can see if gapi is running and some commented alternatives you can test out. |
#9
|
|||
|
|||
![]()
Thanks Nicknack,
tried your code and nothing really helped. Changing to an other WM application hangs the program. Maybe this is only an issue of WM 6.5 of my HTC HD2. Thanks so far Michael |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|