Problem Creating Window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ady

    #1

    Problem Creating Window

    Hi,

    When I create a window as follows

    aWnd->hWnd = CreateWindowEx( WS_EX_CLIENTEDG E, strClassName, strWindowName,
    dwStyle, 10, 10,
    40,40,
    hWndParent, NULL, aWnd->hInstance, NULL);

    The window handle hWnd is null but when I call GetLastError the error code
    is 0???????

    Cany Someone Help?

    Ady


  • William DePalo [MVP VC++ ]

    #2
    Re: Problem Creating Window

    "Ady" <adrian.hirst@t cm.co.uk> wrote in message
    news:uueTaPgfDH A.4024@TK2MSFTN GP11.phx.gbl...[color=blue]
    > When I create a window as follows
    >
    > aWnd->hWnd = CreateWindowEx( WS_EX_CLIENTEDG E, strClassName, strWindowName,
    > dwStyle, 10, 10,
    > 40,40,
    > hWndParent, NULL, aWnd->hInstance, NULL);
    >
    > The window handle hWnd is null but when I call GetLastError the error code
    > is 0???????[/color]

    Does the window get a WM_CREATE message? If so, how is it handled?

    Regards,
    Will


    Comment

    • Ady

      #3
      Re: Problem Creating Window

      it currently doesnt do anything when it gets a create message it just
      returns

      Ady.
      "William DePalo [MVP VC++ ]" <willd.no.spam@ mvps.org> wrote in message
      news:e$GKuShfDH A.576@tk2msftng p13.phx.gbl...[color=blue]
      > "Ady" <adrian.hirst@t cm.co.uk> wrote in message
      > news:uueTaPgfDH A.4024@TK2MSFTN GP11.phx.gbl...[color=green]
      > > When I create a window as follows
      > >
      > > aWnd->hWnd = CreateWindowEx( WS_EX_CLIENTEDG E, strClassName,[/color][/color]
      strWindowName,[color=blue][color=green]
      > > dwStyle, 10, 10,
      > > 40,40,
      > > hWndParent, NULL, aWnd->hInstance, NULL);
      > >
      > > The window handle hWnd is null but when I call GetLastError the error[/color][/color]
      code[color=blue][color=green]
      > > is 0???????[/color]
      >
      > Does the window get a WM_CREATE message? If so, how is it handled?
      >
      > Regards,
      > Will
      >
      >[/color]


      Comment

      • William DePalo [MVP VC++ ]

        #4
        Re: Problem Creating Window

        "Ady" <adrian.hirst@t cm.co.uk> wrote in message
        news:ecd19fpfDH A.616@TK2MSFTNG P11.phx.gbl...[color=blue]
        > it currently doesnt do anything when it gets a create message it just
        > returns[/color]

        Hmm. If it returns 0, the window should be created while -1 cancels the
        creation. If zero is what you are returning you may want to use the SPY tool
        to see if some other message is doing you in.

        Regards,
        Will


        Comment

        Working...