Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
//first step is to get the actual picture object
//it is stored as a CStatic object, or at least an object
//that inherits from CStatic
//nIDResourceItem is the UINT representing the picture
//or, more simply, just the ID of your picture
//this ID can also be in LPCSTR format
CStatic *bitmap=(CStatic*)(AfxGetMainWnd()->GetDlgItem(nIDResourceItem));
//
//next you simply call the member function CStatic::SetBitmap
//on your picture(CStatic) object. The hardest part
//was figureing out how to get the HBITMAP
//handle pointing to the proper bitmap resource.
//nIDResourceBitmap is the UINT of the bitmap
//resource you wish to load. LoadBitmap returns
//the HBITMAP you need to set the bitmap. I don't think
//the MAKEINTRESOURCE is necessary, but the documentation
//had it so I used it. I believe you can just use
//the UINT of the bitmap resource or a string representing
//the name of the UINT in your call to LoadBitmap
//AfxGetResourceHandle obviously returns a handle
//to the location the default resources are loaded
bitmap->SetBitmap(LoadBitmap(AfxGetResourceHandle(), MAKEINTRESOURCE(nIDResourceBitmap)));
//then you simply redraw the CStatic object so you
//can see the changes
bitmap->RedrawWindow();
[code]
//*************************************************************************************************
Like I said, not terribly complicated. It was just a pain to put the peices together. I hope I possibly helped someone else avoid the headaches I had trying to get this seemingly simple problem to work. Happy Programming!!