Thread: Window Style Problem

  1. #1
    Registered User
    Join Date
    Dec 2014
    Posts
    3

    Window Style Problem

    Good morning everyone.

    I'm trying to create a window with the WS_OVERLAPPEDWINDOW style however my RegisterClassEx() function fails and GetLastError() returns value 87 which is an incorrect parameter.

    I've traced this to the window style member in WNDCLASSEX where (I haven't tried this extensively with all of the styles) the WS_OVERLAPPEDWINDOW style produces this error. If I use simpler styles i.e. VREDRAW & HREDRAW then the RegisterClassEx() executes and the window is created.

    If I try to use the individual styles that WS_OVERLAPPEDWINDOW incorporates, even just one of them, then RegisterClassEx() fails.

    Anybody have an insight into this?

    Apologies but I'm at work and don't have access to my code until I get in this afternoon - it's just bothering me so I needed to post it

    I'm using VS 2019 if that helps.

    Thanks for reading,

    R

  2. #2
    Registered User
    Join Date
    Feb 2019
    Posts
    1,077
    WS_OVERLAPPEDWINDOW applies to CreateWindowA() or CreateWindowExA() function, not to Window Class.
    Read the reference at msdn.

  3. #3
    Registered User
    Join Date
    Dec 2014
    Posts
    3
    Thanks for the reply flp.

    That makes sense as I'm making a wrapper class and the style member gets passed into both CreateWindowEx() and RegisterClassEx() through the WNDCLASSEX struct - I'll try this when I get home.

    R

  4. #4
    Registered User
    Join Date
    Dec 2014
    Posts
    3
    Just an FYI that worked thank you flp!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Change window style
    By ekosix in forum Windows Programming
    Replies: 10
    Last Post: 04-28-2011, 03:33 PM
  2. Change Style of An Existing Window
    By Queatrix in forum Windows Programming
    Replies: 1
    Last Post: 08-17-2006, 05:08 PM
  3. Allegro: How to make a Win 32 Style Window?
    By Zeusbwr in forum C++ Programming
    Replies: 5
    Last Post: 11-10-2004, 01:51 AM
  4. Changing the style of a MDI child window
    By The Dog in forum Windows Programming
    Replies: 3
    Last Post: 05-07-2004, 05:44 PM
  5. How to change window style at runtime?
    By Mr. Bitmap in forum Windows Programming
    Replies: 5
    Last Post: 06-09-2002, 04:49 PM

Tags for this Thread