how can i change the windows child styles?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: how can i change the windows child styles?

  1. #1
    Join Date
    Apr 2009
    Posts
    640

    how can i change the windows child styles?

    i did these code for change the border for the STATIC window:
    Code:
    void setBorder(bool border)
        {
            long s;
            if(border==false)
                s = WS_EX_LEFT| WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR;
            else
                s = WS_EX_LEFT| WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_CLIENTEDGE;
    
            long a=(long)SetWindowLongPtr(hwnd,GWL_EXSTYLE,(LONG_PTR)s);
            MessageBox(NULL,to_string(GetLastError()).c_str(),"erro",MB_OK);
            //the SetWindowPos() is for update the control
            SetWindowPos(NULL, 0, 0, 0, 0,
                    SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|
                    SWP_DRAWFRAME,true);
        }
    (the hwnd is value from CreateWindowEx())
    but i get these error from GetLastError(): 6 - ERROR_INVALID_HANDLE.
    why these error?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,390

    Re: how can i change the windows child styles?

    Quote Originally Posted by Cambalinho View Post
    i get these error from GetLastError(): 6 - ERROR_INVALID_HANDLE.
    why these error?
    Which API function failed? And how did you check it had failed? I don't see any checking the functions calls!
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center