Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to display a transparent gif on top of the screen?

How to display a transparent gif on top of the screen?

Scheduled Pinned Locked Moved C / C++ / MFC
c++cssgraphicslinuxtutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mamtz
    wrote on last edited by
    #1

    Hi I'm very fresh with MFC programming. My program works on the background, when the user clicks on a predefined hot key, the app performes the action and what I'm trying to do is to notify the user with an ok image on top of the screen for less than a second and disappear. I tried to create a dialog without window borders with a picture control within, the problems i encountered are: a. The picture control takes only bmp files which are can not be transparent. b. Whenever i set the dialog as transparent it is not become on top and start to act weird. The folowing code works fine except that the picture is not transparent. 1. When the action performed: AfxBeginThread(notify,NULL); 2. Opennig the dialog: UINT notify(LPVOID pParam){    NotifyDialog saved;    saved.DoModal();    return TRUE; } 3. The initialization of the dialog: BOOL NotifyDialog::OnInitDialog() {    CDialog::OnInitDialog();    hDlg = this->m_hWnd; //Saving dialog handler for closing it    AfxBeginThread(WaitingToHideIcon,(LPVOID)NULL);    return TRUE; } 4. Closing the dialog: UINT WaitingToHideIcon(LPVOID pParam){    Sleep(600);    EndDialog(hDlg,1);    return 0; } 5. The resource of the dialog and the picture control: IDD_NOTIFYDIALOG DIALOGEX 0, 0, 58, 71 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_SYSMENU EXSTYLE WS_EX_TOPMOST FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL 143,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE,0,0, 58,71 END IDB_BITMAP1 BITMAP "res\\OkHandSign.bmp" I would love to get suggestions and improvements on how to do this Thanks a lot Mamtz

    R 1 Reply Last reply
    0
    • M mamtz

      Hi I'm very fresh with MFC programming. My program works on the background, when the user clicks on a predefined hot key, the app performes the action and what I'm trying to do is to notify the user with an ok image on top of the screen for less than a second and disappear. I tried to create a dialog without window borders with a picture control within, the problems i encountered are: a. The picture control takes only bmp files which are can not be transparent. b. Whenever i set the dialog as transparent it is not become on top and start to act weird. The folowing code works fine except that the picture is not transparent. 1. When the action performed: AfxBeginThread(notify,NULL); 2. Opennig the dialog: UINT notify(LPVOID pParam){    NotifyDialog saved;    saved.DoModal();    return TRUE; } 3. The initialization of the dialog: BOOL NotifyDialog::OnInitDialog() {    CDialog::OnInitDialog();    hDlg = this->m_hWnd; //Saving dialog handler for closing it    AfxBeginThread(WaitingToHideIcon,(LPVOID)NULL);    return TRUE; } 4. Closing the dialog: UINT WaitingToHideIcon(LPVOID pParam){    Sleep(600);    EndDialog(hDlg,1);    return 0; } 5. The resource of the dialog and the picture control: IDD_NOTIFYDIALOG DIALOGEX 0, 0, 58, 71 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_SYSMENU EXSTYLE WS_EX_TOPMOST FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL 143,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE,0,0, 58,71 END IDB_BITMAP1 BITMAP "res\\OkHandSign.bmp" I would love to get suggestions and improvements on how to do this Thanks a lot Mamtz

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      mamtz wrote: The picture control takes only bmp files which are can not be transparent. This[^] article may help. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups