somehow(Dont ask how) fixed the above problem.
new problem though:

Code:
 HBITMAP hBitmap = (HBITMAP)LoadImage(GetModuleHandle(NULL),(LPCTSTR)"C:\\WINDOWS\\Zapotec.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE | LR_CREATEDIBSECTION);
 if (hBitmap == NULL) { 
	 lstrcpy(data,"E_RR Image is Null"); 
	 return 3;
 }
 
HBRUSH hBrush = CreatePatternBrush(hBitmap); 
 SetClassLong(newrich, GCL_HBRBACKGROUND, (LONG)hBrush);   


says "Not enough storage is available to process this command." (Error 8)

any clues?