Now: Tutorial for Web and Software Design > Programming > c > Programming Content
> MFC Window without Title Bar [Bookmark it]
MFC Window without Title Bar

   In this Program the Create Api Call to create the window takes the third parameter that is window style as WS_POPUP, which is responsible for creating the window without any title bar.

   Since there is no title bar there won't be any close button, so in order to exit the application I used PostQuitMessage Api call in OnRButtonDown event of the window, which posts the WM_QUITMESSAGE to the Message queue so that when ever user presses right button on the window the application will exit. Generally we see some funny games without any title bar where this code can be used.

An Win 32 Application , Source Code is as follows...........


 Source.cpp

 //Creating a Window without any Title Bar such that it just appears as your desktop

 #include <afxwin.h>

 class CMyFrame : public CFrameWnd
 {
  public: 
  
  CMyFrame()
  {
   //Call to create a Window without any titlebar
   Create(NULL,"",WS_POPUP);
  
  }

  void OnRButtonDown()
  {
  
   PostQuitMessage(1);

  }

   DECLARE_MESSAGE_MAP()
 };


 BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
  ON_WM_RBUTTONDOWN()
 END_MESSAGE_MAP()

 
 class CMyApp :public CWinApp
  {
  CMyFrame *frameWndObj;
  public:
  BOOL InitInstance()
  {
   frameWndObj = new CMyFrame();
   m_pMainWnd = frameWndObj;
   //shows the window with maximum size.
   m_pMainWnd->ShowWindow(3);
   return 1;
  }

  };

 CMyApp anApp;


[Bookmark][Print] [Close][To Top]
  • Prev Article-Programming:

  • Next Article-Programming:
  • Related Materias
    Implementation Of Calculat
    Conversion of Color images
    Using a Custom ActiveX Con
    MFC GDI Plus Picture Box
    MFC GDI Plus thumbnail CLi
    Animation Control derived 
    Windows Socket Server Prog
    Transparent MFC Window
    Visual C++/MFC Sample on I
    MFC General Owner Draw iss
    Topics
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Graphic Design Tutorial
     

    Coreldraw Tutorial

      Illustrator Tutorial
      3D Graphics Articles
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial&Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial&Articles
     

    XML Style Tutorial

      AJAX Tutorial
      XML Mobile
    Flash Tutorial&Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial&Articles
     

    Linux Tutorial

      Symbian Tutorial
      MacOS Tutorial