CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Bmp button.

  1. #1
    Join Date
    Oct 1999
    Location
    Sweden
    Posts
    33

    Bmp button.

    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


  2. #2

    Re: Bmp button.


    // 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/
    [email protected]

  3. #3
    Join Date
    Oct 1999
    Location
    Sweden
    Posts
    33

    Re: Bmp button.

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured