Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Problems with behaviour of the form

  1. #1

    Problems with behaviour of the form

    Hi!

    just to mention: the Omega forums are down again, I already tried to reach Bobby. I asked lifepower @Turbo.Gamedev.net to send people with questions here or to my forum.

    So a question myself, not sure if it is really about Omega, I think all other headers will have the same problems.

    Hard for me to tell this in english, I am not sure about some words.

    The windows Task-Bar (?) on the bottom (where the Start button and tasks are shown) can be set to 'Always visible' and 'automatic in background' (translated by me, I have a german windows and am not sure how it says in english windows). When both is set and my application starts fullscreen, I see my application but every few frames the task-bar shines through, looks awfull and sometimes I don't have mouse in my application (I guess it does not have focus).

    Some other problem:
    I played fullscreen, then I stopped and was minimized because some background program (in this case mail software) told me something. How do I prevent it from being stopped from the background tasks?

    Thanks a lot,
    firle

  2. #2

    Problems with behaviour of the form

    I'd suggest using either Application or your form's "BringtoFront" method in the on create event.

    You've got the "Always on top" option checked, and so it was just being obedient, much to the irritation of DX and you.

  3. #3

    Problems with behaviour of the form

    Hi Robert,

    thanks for the info.

    I'd suggest using either Application or your form's "BringtoFront" method in the on create event.
    Do you mean in the Form itself at the end of formload or in the project file after creating the form?

    Firle

  4. #4

    Problems with behaviour of the form

    In the form's OnCreate event, or where ever you do the initialization for your project.

  5. #5

  6. #6

    Problems with behaviour of the form

    No problem. Been awhile since I had an app that wouldn't focus, had one or two, but if you get an error try moving the call to the OnShow event.

  7. #7

    Problems with behaviour of the form

    I tried various methods but they weren't 100%. For example, people who set up the task bar as auto hide and always on top it would still come into view when the mouse was at the bottom edge of teh screen.

    In the end I just used win api to remove the taskbar and put it back on close of the app.

    Only hassle is that the taskbar is gone if your app crashes.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  8. #8

    Problems with behaviour of the form

    Hi Czar,

    can you give me a piece of code how you let it dissappear?

    Did you do something else like Stayontop or Bringtofront?

    Thanks,
    Firlefanz

  9. #9

    Problems with behaviour of the form

    Code snippet from MS DXUT framework, showing how to correctly switch to fullscreen mode (without some code for saving current window state):
    [pascal] // Going to fullscreen mode
    // Hide the window to avoid animation of blank windows
    ShowWindow(DXUTGetHWNDDeviceFullScreen, SW_HIDE);

    // Set FS window style
    SetWindowLong(DXUTGetHWNDDeviceFullScreen, GWL_STYLE, Integer(WS_POPUP or WS_SYSMENU));

    // If using the same window for windowed and fullscreen mode, save and remove menu
    if (DXUTGetHWNDDeviceFullScreen = DXUTGetHWNDDeviceWindowed) then
    begin
    hMenu := GetMenu(DXUTGetHWNDDeviceFullScreen);
    GetDXUTState.SetMenu(hMenu);
    SetMenu(DXUTGetHWNDDeviceFullScreen, 0);
    end;

    ZeroMemory(@wpFullscreen, SizeOf(TWindowPlacement));
    wpFullscreen.length := SizeOf(TWindowPlacement);
    GetWindowPlacement(DXUTGetHWNDDeviceFullScreen, @wpFullscreen);
    if ((wpFullscreen.flags and WPF_RESTORETOMAXIMIZED) <> 0) then
    begin
    // Restore the window to normal if the window was maximized then minimized. This causes the
    // WPF_RESTORETOMAXIMIZED flag to be set which will cause SW_RESTORE to restore the
    // window from minimized to maxmized which isn't what we want
    with wpFullscreen do flags := flags and not WPF_RESTORETOMAXIMIZED;
    wpFullscreen.showCmd := SW_RESTORE;
    SetWindowPlacement(DXUTGetHWNDDeviceFullScreen, @wpFullscreen);
    end;
    [/pascal]
    The main line for you is:
    SetWindowLong(DXUTGetHWNDDeviceFullScreen, GWL_STYLE, Integer(WS_POPUP or WS_SYSMENU));
    There are only 10 types of people in this world; those who understand binary and those who don't.

  10. #10

    Problems with behaviour of the form

    Hi Clootie,

    thanks a lot, I'll try that also.

    If I use this, should I also use BringtoFront and fsStayontop or should I cancel those?

    Thanks,
    Firle

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •