Page 1 of 1

Native windows problem..

PostPosted: Oct 13, 2009 @ 10:11am
by RapchikProgrammer
Hey, i have made a text box using native window with createwindowex.. now the problem is when i click on it then the focus gets shifted to the textbox and the OnNextFrame is no longer called.. How do i shift the focus back to the parent edgelib window? I have tried setfocus and sending a WM_SETFOCUS message but both are not working.. if i minimize and restore my window then the apps main loop works fine, otherwise if i click on the textbox it doesnt work.. and i am handling messages using OnNativeEvent..

PostPosted: Oct 13, 2009 @ 10:15am
by RapchikProgrammer
I just checked again with setfocus the focus is shifting to the main window but the OnNextFrame function isnt being called like it should..

PostPosted: Oct 15, 2009 @ 1:06pm
by edge
Hi,

To solve the issue you could keep the application running when the window loses focus. Set config->focussuspend to false in OnFrameworkConfig. The window will be suspended while minimized though.

PostPosted: Oct 15, 2009 @ 2:02pm
by RapchikProgrammer
Thanks that sorted it out..

PostPosted: Oct 15, 2009 @ 2:24pm
by RapchikProgrammer
Theres still one problem tho, now when i click on that textbox then the focus is on the textbox.. and when i click the continue button that removes the textbox and continues the game, im getting the stylus down and up events in OnNative event and not in OnStylusDown and OnStylusUp events, edgelibs not getting these events.. even though i have used setfocus after removing the textbox to give the focus back to the window..

PostPosted: Oct 16, 2009 @ 2:12pm
by RapchikProgrammer
Another issue, i have been only tesing on pc till now.. i tried to run it on the cellphone and im facing two problems.. firstly, as soon as i click on the textbox the window minimizes.. and if i restore i only see the textbox and no background as i am not refreshing the complete display ofcourse, so what might be causing this.. the textbox is the child of the main window and i am not seeing this issue in windows, just windows mobile..

secondly my game is running in landscape mode.. i have set DOR_LANDSCAPE but it seems like only the edgelib window is in landscape but the child is still made in portrait mode.. because if i run the game on my wm device the textbox is displayed sideways.. its going from centre to up like in portait mode not centre to right like it should.. if i hold the phone in landscape mode before running the game and let the phones tilt orientation mechanism kick in and set the phones orientation to landscape than it works fine but otherwise it doesnt..

PostPosted: Oct 17, 2009 @ 8:51pm
by RapchikProgrammer
BTW edge our game is in the releasing stages.. and all this code is supposed to be for authorization (entering license key) which the last stage.. so could you please send me an im id or maybe check the forums a bit regularly so that we can get over these problems and release our game asap..

PostPosted: Oct 19, 2009 @ 8:35am
by edge
Hi,

Unfortunately, I can't say why the parent window doesn't gain focus when the child window is removed, perhaps Windows only allow childs to obtain focus in your situation? Maybe changing the order of calling SetFocus and DestroyWindow may help?

To prevent minimizing your application, set config->focusminimize to false in OnFrameworkConfig.

The landscape/textbox issue might become a problem. In certain cases, you can't prevent the orientation from changing (when the user slides out his keyboard for example). This will make the EDGELIB application run in landscape, while the texbox changes to portrait. You can force the orientation with ChangeDisplaySettingsEx and DM_DISPLAYORIENTATION, but I think it won't solve the issue mentioned above. The best way to handle this is to support multiple orientations and set the config->orientation option to DOR_AUTO.