Code:
void setparent(HWND parent)
    {
        static int i=i+1;
        string strclass=labelclassprop + to_string(i);
        labelclassprop=strclass.c_str();
        WNDCLASS wc;
		HINSTANCE mod = (HINSTANCE)GetModuleHandle(NULL);

	    ZeroMemory(&wc, sizeof(WNDCLASS));
		GetClassInfo(mod, "STATIC", &wc);

		wc.hInstance = mod;
		wc.lpszClassName = labelclassprop;
		wc.hbrBackground =  CreateSolidBrush(RGB(255,0,0));

		// store the old WNDPROC of the EDIT window class
		// store the old WNDPROC of the EDIT window class
        SetProp(parent, labelpropname, (HANDLE)wc.lpfnWndProc);
        //SetProp(parent, labelclassprop, (HANDLE)this);

        //UpdateWindow(hwnd);
	// replace it with local WNDPROC
	wc.lpfnWndProc = WndProc;

	// register the new window class, "ShEdit"
	if (!RegisterClass(&wc))
		MessageBox(NULL, "error in register", "error", MB_OK);

        hwnd = CreateWindowEx(
            WS_EX_LEFT| WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_TRANSPARENT,
            labelclassprop,
            labelclassprop,
            SS_LEFT|WS_CHILD|WS_VISIBLE|WS_OVERLAPPED,
            100, 100, 100, 100,
            parent,
            NULL,
            mod,
            (LPVOID)this);

	if (hwnd == NULL)
		MessageBox(NULL, "error in create", "error", MB_OK);

	//SetProp(parent, labelpropname, (HANDLE)wc.lpfnWndProc);
        SetProp(hwnd, labelclassprop, (HANDLE)this);
        UpdateWindow(hwnd);
    }