Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to make the border and titlebar dissapear

How to make the border and titlebar dissapear

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christoffer Sandberg
    wrote on last edited by
    #1

    I got a request to make a program that seamlessly writes out some generic info on the background on a Windows 2000 (or higher) machine. (info is such as quote of the hour, fre RAM, incoming mails, current song in Winamp, whaterver info that can be summarized in short strings, you get the idea) Well, such a program needs a few properties: Transparancy, Not able to be activated, not show up in the taskbar. More ofcourse, but for now these are the important ones. Trancaparency is easely fixed, just a layered window WS_EX_LAYERED with a call to the SetLayeredWindowAttributes function and selecting a COLORREF color to be treated as transparent. Also giving it the WS_EX_NOACTIVATE style unables the windows to be in the foreground. And making it not able to show up in the taskbar, well, a toolbar have that property, so giving it the WS_EX_TOOLWINDOW style solves that problem. Now the part that I cannot solve remains, how to make the border, and most importantly, the titlebar to dissapear? (no x-shutdown icon isn't a problem, just use the commandline and send a shutdown mesage or something) But for it to fit nicely onto the desktop background I need to remove the titlebar and border. Anyone who knows ? // Christoffer Sandberg , christoffer_sandberg@hotmail

    R 1 Reply Last reply
    0
    • C Christoffer Sandberg

      I got a request to make a program that seamlessly writes out some generic info on the background on a Windows 2000 (or higher) machine. (info is such as quote of the hour, fre RAM, incoming mails, current song in Winamp, whaterver info that can be summarized in short strings, you get the idea) Well, such a program needs a few properties: Transparancy, Not able to be activated, not show up in the taskbar. More ofcourse, but for now these are the important ones. Trancaparency is easely fixed, just a layered window WS_EX_LAYERED with a call to the SetLayeredWindowAttributes function and selecting a COLORREF color to be treated as transparent. Also giving it the WS_EX_NOACTIVATE style unables the windows to be in the foreground. And making it not able to show up in the taskbar, well, a toolbar have that property, so giving it the WS_EX_TOOLWINDOW style solves that problem. Now the part that I cannot solve remains, how to make the border, and most importantly, the titlebar to dissapear? (no x-shutdown icon isn't a problem, just use the commandline and send a shutdown mesage or something) But for it to fit nicely onto the desktop background I need to remove the titlebar and border. Anyone who knows ? // Christoffer Sandberg , christoffer_sandberg@hotmail

      R Offline
      R Offline
      Rui Lopes
      wrote on last edited by
      #2

      Well, if you are using the dialog editor from vc++, just change the border style to 'none' using the dialog properties 'styles' tab.... or with c++ code, call the ModifyStyle(WS_OVERLAPPEDWINDOW, 0, SWP_FRAMECHANGED) of your window class, and you have a window without any frame! ---- Rui Lopes

      C 1 Reply Last reply
      0
      • R Rui Lopes

        Well, if you are using the dialog editor from vc++, just change the border style to 'none' using the dialog properties 'styles' tab.... or with c++ code, call the ModifyStyle(WS_OVERLAPPEDWINDOW, 0, SWP_FRAMECHANGED) of your window class, and you have a window without any frame! ---- Rui Lopes

        C Offline
        C Offline
        Christoffer Sandberg
        wrote on last edited by
        #3

        Ahh, that is indeed a neat function, unfortenatly is is a member of the CWindow class (ATL) or the CWnd (MFC)(atleast what I was able to figure out). What I have is a standard Win32 program (none ATL, none MFC) application, so I use the RegisterClassEx and CreateWindowEx functions in the API to do my work, so all I have access to is the hInstance and hWnd of the program/window. Is there anyway to go from there and still being able to remove the the WS_OVERLAPPEDWINDOW style?

        R 1 Reply Last reply
        0
        • C Christoffer Sandberg

          Ahh, that is indeed a neat function, unfortenatly is is a member of the CWindow class (ATL) or the CWnd (MFC)(atleast what I was able to figure out). What I have is a standard Win32 program (none ATL, none MFC) application, so I use the RegisterClassEx and CreateWindowEx functions in the API to do my work, so all I have access to is the hInstance and hWnd of the program/window. Is there anyway to go from there and still being able to remove the the WS_OVERLAPPEDWINDOW style?

          R Offline
          R Offline
          Rui Lopes
          wrote on last edited by
          #4

          Well, the ModifyStyle is a straitforward function to implement. Use this code instead of the ModifyWindow, SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE)&~WS_OVERLAPPEDWINDOW); ::SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_FRAMECHANGED); But since you are using the CreateWindowEx, you can create the window without the WS_OVERLAPPEDWINDOW style, so there is no need for this code.... ---- Rui Lopes

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups