In Depth Banner
Skip Navigation Links

Select your preferred language

Creating the layered window.

    public void Create()

    {

      CreateParams cp=new CreateParams();

      cp.Style= (int)WSDefs.WS_POPUP;

      cp.ClassStyle=(int)CSDefs.CS_OWNDC;

      cp.ExStyle |= (int)WSDefs.WS_EX_LAYERED | (int)WSDefs.WS_EX_TOPMOST;

      cp.ClassName="tooltips_class32";

      cp.X=(SystemInformation.VirtualScreen.Width/2)-200;

      cp.Y=(SystemInformation.VirtualScreen.Height/2)-200;

      cp.Width=400;

      cp.Height=400;

      cp.Parent=IntPtr.Zero;

      CreateHandle(cp);

    }

 

Note how this code also gives the window a topmost style and positions the window in the center of the screen.

 

Return to the article

Copyright © Bob Powell 2003-2009. All rights reserved