GetClientRect returns the area of the drawable area inside the window. It will usually return something like 0,0,width,height in your rect structure GetWindowRect returns the co-ordinates of the Window itself relative to the upper left of the screen so they will be rather large. If you try to use GetWindowRect co-ordinates to draw on the window they will be way outside the right and bottom and the drawing wont be visible unless you drag the window right up to the top left off screen. You need to use GetClientRect co-ordinates to draw with. Looking at your code I am guessing this line is the problem if you have a position problem
dc.BitBlt(137,107,176,50,&memDC,rect.left,rect.top,SRCCOPY);
Are you sure that is right?