4 Replies - 526 Views - Last Post: 02 April 2013 - 03:21 PM Rate Topic: -----

#1 schourend  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-April 13

Powerpoint fullscreen overlapping Form

Posted 02 April 2013 - 03:24 AM

Hi,

I am trying to create a toolbar/form (SHappBarMessage)to show a RSS feed on the top of the screen(for narrowcasting)
All works well, it resizes the maximized screens to not overlap the toolbar area.

But when I play a powerpoint in fullscreen however it does overlaps the toolbar.
I can set the toolbar as topmost but than the powerpoint area is not resized it just falls underneath the toolbar making a piece of the presentation fall behind the toolbar. (see attachments)

Can someone point me in the right direction?


Thanks for any helpful reply.

Danny

Attached image(s)

  • Attached Image
  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Powerpoint fullscreen overlapping Form

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,467
  • Joined: 05-May 12

Re: Powerpoint fullscreen overlapping Form

Posted 02 April 2013 - 05:26 AM

Are you listening for the ABM_FULLSCREENAPP message? If so, you should let the other app go full screen and not fight for screen real estate.

http://msdn.microsof...5(v=vs.85).aspx
Was This Post Helpful? 0
  • +
  • -

#3 schourend  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-April 13

Re: Powerpoint fullscreen overlapping Form

Posted 02 April 2013 - 11:06 AM

I'm a newbie at C# :whistling:

I'm using the AppBar at codeproject.com (See code)

I found:

enum ABNotify : int
        {
            ABN_STATECHANGE=0,
            ABN_POSCHANGED,
            ABN_FULLSCREENAPP,
            ABN_WINDOWARRANGE
        }


And:

private void ABSetPos()
        {
            APPBARDATA abd = new APPBARDATA();
            abd.cbSize = Marshal.SizeOf(abd);
            abd.hWnd = this.Handle;
            abd.uEdge = (int)ABEdge.ABE_BOTTOM;

            if (abd.uEdge == (int)ABEdge.ABE_LEFT || abd.uEdge == (int)ABEdge.ABE_RIGHT) 
            {
                abd.rc.top = 0;
                abd.rc.bottom = SystemInformation.PrimaryMonitorSize.Height;
                if (abd.uEdge == (int)ABEdge.ABE_LEFT) 
                {
                    abd.rc.left = 0;
                    abd.rc.right = Size.Width;
                }
                else 
                {
                    abd.rc.right = SystemInformation.PrimaryMonitorSize.Width;
                    abd.rc.left = abd.rc.right - Size.Width;
                }

            }
            else 
            {
                abd.rc.left = 0;
                abd.rc.right = SystemInformation.PrimaryMonitorSize.Width;
                if (abd.uEdge == (int)ABEdge.ABE_TOP) 
                {
                    abd.rc.top = 0;
                    abd.rc.bottom = Size.Height;
                }
                else 
                {
                    abd.rc.bottom = SystemInformation.PrimaryMonitorSize.Height;
                    abd.rc.top = abd.rc.bottom - Size.Height;
                }
            }

            // Query the system for an approved size and position. 
            SHAppBarMessage((int)ABMsg.ABM_QUERYPOS, ref abd); 

            // Adjust the rectangle, depending on the edge to which the 
            // appbar is anchored. 
            switch (abd.uEdge) 
            { 
                case (int)ABEdge.ABE_LEFT: 
                    abd.rc.right = abd.rc.left + Size.Width;
                    break; 
                case (int)ABEdge.ABE_RIGHT: 
                    abd.rc.left= abd.rc.right - Size.Width;
                    break; 
                case (int)ABEdge.ABE_TOP: 
                    abd.rc.bottom = abd.rc.top + Size.Height;
                    break; 
                case (int)ABEdge.ABE_BOTTOM: 
                    abd.rc.top = abd.rc.bottom - Size.Height;
                    break; 
            }

            // Pass the final bounding rectangle to the system. 
            SHAppBarMessage((int)ABMsg.ABM_SETPOS, ref abd); 

            // Move and size the appbar so that it conforms to the 
            // bounding rectangle passed to the system. 
            MoveWindow(abd.hWnd, abd.rc.left, abd.rc.top, 
                abd.rc.right - abd.rc.left, abd.rc.bottom - abd.rc.top, true); 
        }

        protected override void WndProc(ref System.Windows.Forms.Message m)
        {
            if (m.Msg == uCallBack)
            {
                switch(m.WParam.ToInt32())
                {
                    case (int)ABNotify.ABN_POSCHANGED:
                        ABSetPos();
                        break;
                }
            }

            base.WndProc(ref m);
        }



Don't see anything about manually set z-orders?
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,467
  • Joined: 05-May 12

Re: Powerpoint fullscreen overlapping Form

Posted 02 April 2013 - 02:55 PM

If you change the code to use SetWindowPos() instead of MoveWindow(), you'll have the opportunity to change the Z order.
http://msdn.microsof...5(v=vs.85).aspx
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3819
  • View blog
  • Posts: 13,537
  • Joined: 12-December 12

Re: Powerpoint fullscreen overlapping Form

Posted 02 April 2013 - 03:21 PM

It is worth noting that that tutorial is from 2004. It uses a lot of API calls so this age might not be a concern. However, I would generally prefer to find more up-to-date tutorials, where possible.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1