Thread: Design With Regards To A Splash Window - Custom Message?

  1. #1
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465

    Design With Regards To A Splash Window - Custom Message?

    Something like this.

    Code:
    CWindow 
    { 
        CWindow() { createwindowex, etc. }
        virtual void initialize() { } 
    };
    
    COpenGLWindow : CWindow 
    {
        COpenGLWindow() : CWindow() { }
        virtual void initialize() { lengthy operation; }
    };
    
    CSplash : CWindow
    {
        CSplash() { }
        virtual void initialize() { }
    };
    Essentially, I want to order the creation of these guys so as to make the CSplash screen appear during the initialization of a COpenGLWindow. Both windows use the same message loop but different window classes. Basically I was thinking something like:

    Code:
    windowprocedureofglwindow
    {
           static CSplash * c;
    
           WM_CREATE: 
                  c = new CSplash();
                  initialize the oglwindow
                  delete c;
    }
    But the problem is, I can't get the 'this' pointer to my glwindow to the window procedure passing it through means of lpCreateParams of anything because it is not fully formed. Is there a different way I could pass information in a manner similar to lpCreateParams to the window procedure by means of some message? Is there a special way to define my own message?

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Read this:

    Message numbers in the second range (WM_USER through 0x7FFF) can be defined and used by an application to send messages within a private window class. These values cannot be used to define messages that are meaningful throughout an application, because some predefined window classes already define values in this range. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use these values. Messages in this range should not be sent to other applications unless the applications have been designed to exchange messages and to attach the same meaning to the message numbers.
    Werks now.
    Last edited by Ken Fitlike; 12-02-2006 at 06:34 AM. Reason: changed from code to quote tags to reduce horizontal scrolling

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Okay. Another question. I want my main thread window to terminate the window belonging to another thread (my splash window). I have read lots of things saying not to like PostMessage a WM_QUIT but to instead do a PostQuitMessage. However, I need to PostThreadQuitMessage or something. Is there any special reasoning behind this WM_QUIT stuff that would make it harmful to PostThreadMessage a WM_QUIT?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  2. Making a script language?
    By Blackroot in forum Game Programming
    Replies: 10
    Last Post: 02-16-2006, 02:22 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. Adding colour & bmps to a Win 32 Window??
    By carey_sizer in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2004, 05:55 PM