Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1013015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:01:59+00:00 2026-05-16T10:01:59+00:00

How can you create a window without caption and border using CreateWindowEx()? And I

  • 0

How can you create a window without caption and border using CreateWindowEx()? And I why do you use ‘|’ OR operator to combine styles instead of ‘&’ And?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:01:59+00:00Added an answer on May 16, 2026 at 10:01 am
    int WINAPI WinMain(....)
    {
        MSG msg;
        WNDCLASS wc={0};
        wc.lpszClassName="MyClass";
        wc.lpfnWndProc=DefWindowProc;//You MUST use your own wndproc here
        wc.hInstance=hInstance;
        wc.hbrBackground=(HBRUSH)(COLOR_3DFACE+1);
        wc.hCursor=LoadCursor(NULL,IDC_ARROW);
        if (!RegisterClass(&wc)) {/*Handle Error*/}
        HWND hwnd;
        hwnd=CreateWindowEx(0,wc.lpszClassName,0,WS_POPUP|WS_VISIBLE|WS_SYSMENU,9,9,99,99,0,0,0,0);
        if (!hwnd) {/*Handle Error*/}
        while(GetMessage(&msg,0,0,0)>0)DispatchMessage(&msg);
        return 0;
    }
    

    If you want a border, you can add WS_BORDER or WS_DLGFRAME (Not both). If you don’t want to show the window in the taskbar, add the WS_EX_TOOLWINDOW extended style.

    As to why you need to bitwise OR the styles; OR will combine all the style values, AND is used (by windows) to check which styles are set.
    Say we had two styles (WS_FOO=1,WS_BAR=2):

    • 1 AND 2 = 0 (Binary: 01 AND 10 = 00)
    • 1 OR 2 = 3 (Binary: 01 OR 10 = 11)

    See wikipedia for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using CreateWindowEx() function to create an EDIT window, i.e. where a user can
I want to use CGL or NSOpenGL to create an OpenGL window without using
Is there any tools using which I can use to create Windows forms from
How can you use imagemagick from python without opening a new command line window
Can I create a window without this topbar? : I want a window like
Can anybody explain me, how can I create WPF Window in BackgroundWorker thread without
For Android GUI: I would like to create a window that I can pull
I have a console application from which I create a window. I can render
Can I create a native thread on Windows running MRI, using the CreateThread API
Without resources I can create my UI with a complex array of CreateWindow() and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.