CreatewindowEx Function

Orlando Gondar 61 Reputation points
2022-06-22T11:15:18.647+00:00

I remember, I used CreatewindowsEx in order to change the borders or
apply any extended style to the window.
However after Windows 10, this do not work any more.

Is there a way to use those extended styles any more?

I using C++ on Visual studio 2022.

Thanks in advance.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,651 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,758 questions
{count} votes

8 answers

Sort by: Most helpful
  1. Castorix31 85,806 Reputation points
    2022-06-22T11:29:45.813+00:00

    However after Windows 10, this do not work any more.

    What does not work anymore ?
    For example, I had posted a test in this thread on Windows 10 with WS_EX_LAYERED for transparency, and it works normally

    1 person found this answer helpful.
    0 comments No comments

  2. Orlando Gondar 61 Reputation points
    2022-06-23T12:27:09.213+00:00

    This is the code I use to used, and always responded perfectly, no matter what extended style.
    I showing you the main parts.
    ( I had use this two too with no problem: WS_EX_CLIENTEDGE & WS_EX_DLGMODALFRAME )

    WNDCLASSEX wcex;

    wcex.cbSize = sizeof(WNDCLASSEX);
    wcex.style = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc = WndProc;
    wcex.cbClsExtra = 0;
    wcex.cbWndExtra = 0;
    wcex.hInstance = hInstance;
    wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
    wcex.hbrBackground = (HBRUSH)BLKBRS;
    wcex.lpszMenuName = NULL;
    wcex.lpszClassName = szAppName;
    wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    return 1;

    // Create the Window
    hWndMain=CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,szAppName,szAppName,WS_CAPTION|
    WS_SYSMENU,(SCNWTH-WISZW)/2,(SCNHTH-WISZD)/2,WISZW,WISZD,NULL,NULL,hInstance,NULL);


  3. Orlando Gondar 61 Reputation points
    2022-06-23T13:40:27.483+00:00

    Is there, I did not copy and paste, because you know have to be part of the code.

    wndclass.cbSize = sizeof(WNDCLASSEX);
    wndclass.style = CS_HREDRAW|CS_VREDRAW; // CS_DBLCLKS
    wndclass.lpfnWndProc = MainWndProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = hInstance;
    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
    wndclass.hIcon = (HICON)LoadImage(hInst,"MICON",IMAGE_ICON,32,32,0);
    wndclass.hIconSm = (HICON)LoadImage(hInst,"MICON",IMAGE_ICON,16,16,0);
    wndclass.hbrBackground = CreateSolidBrush(RGB(255,255,255));
    wndclass.lpszMenuName = "MMENU"; // Menu Name if Any
    wndclass.lpszClassName = szAppName;

    if(!RegisterClassEx(&wndclass)) return FALSE;

    if(!(hWndMain=CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,szAppName,szAppName,WS_CAPTION|
    WS_SYSMENU,(SCNWTH-500)/2,(SCNHTH-368)/2,500,376,NULL,(HMENU)NULL,hInstance,NULL))
    ) return FALSE;


  4. Orlando Gondar 61 Reputation points
    2022-06-23T18:27:57.747+00:00

    Well does not work here, all I get is the same flat window no matter what style I specify.


  5. Orlando Gondar 61 Reputation points
    2022-06-23T19:02:45.233+00:00

    Like I said in the beginning, everything was working PERFECT in the beginning
    however, after started using windows 10, that's when the problem started-up.
    I wonder is the problem is on something like this, check this link.

    https://superuser.com/questions/1098708/is-it-possible-to-turn-visible-the-invisible-windows-borders-of-windows-10

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.