Click to See Complete Forum and Search --> : Bmp button.


Project
October 6th, 1999, 01:05 PM
How do i launch a .html document in the default browser?
And can i have a bmp picture as a command button.
I have the bmp file in resources and put it on the form using a picture frame (or what they r called). And how do i launch the .html file in the default browser when the picture is clicked???

Thanks

Anish Mistry
October 6th, 1999, 08:34 PM
// open a webpage... do this when you click on the button
int showcmd = 0;
ShellExecute(NULL, _T("open"), "http://am-productions.8m.com/", NULL,NULL, showcmd);

// add the bitmap to the button do this when you load the dialog...make sure that you have the bitmap field checked in the properties box
CButton *pBtn = (CButton *)GetDlgItem(IDC_BUTTON_WEBSITE);
HBITMAP hBitmap = ::LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP_LOGO));
pBtn->SetBitmap(hBitmap);





Anish Mistry
http://am-productions.8m.com/
amistry@am-productions.8m.com

Project
October 8th, 1999, 06:14 AM
Thanks for the code. But where was i supposed to put it?
I tried in InitInstance for example but it said:
GetDlgItem ...something about parametres.

Thanks

Just a newbie