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. SetLayeredWindowAttributes and bitmaps

SetLayeredWindowAttributes and bitmaps

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelp
4 Posts 3 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.
  • D Offline
    D Offline
    dj4400
    wrote on last edited by
    #1

    Hi all, I am using SetLayeredWindowAttributes in order to create an outlook like message. I have a special show function which moves (with SetwindowPos) the dialog and changes its opcaity while moving. :) The dialog fades in (both by movement and opacity change) around the system tray area, and after 3 seconds fades out. When i call the show function for the first time, all controls on the dialog (bitmap, static text etc.) appear as black boxes, until the fade in effect is done, then he controls appear properly. :confused: Consequent calls to the show function works properly - it shows the controls through all the fade in and fade out procedure. If i create a thread and call the show function from it then it works fine for the first call also. :confused::confused: I would appriciate it if someone can explain the differnece between calling the function from another thread or form the window thread, the drawing procedure of a dialog and may be offer a way to solve this problem without creating a new thread. Thanks Shimon

    N N 2 Replies Last reply
    0
    • D dj4400

      Hi all, I am using SetLayeredWindowAttributes in order to create an outlook like message. I have a special show function which moves (with SetwindowPos) the dialog and changes its opcaity while moving. :) The dialog fades in (both by movement and opacity change) around the system tray area, and after 3 seconds fades out. When i call the show function for the first time, all controls on the dialog (bitmap, static text etc.) appear as black boxes, until the fade in effect is done, then he controls appear properly. :confused: Consequent calls to the show function works properly - it shows the controls through all the fade in and fade out procedure. If i create a thread and call the show function from it then it works fine for the first call also. :confused::confused: I would appriciate it if someone can explain the differnece between calling the function from another thread or form the window thread, the drawing procedure of a dialog and may be offer a way to solve this problem without creating a new thread. Thanks Shimon

      N Offline
      N Offline
      Nishad S
      wrote on last edited by
      #2

      One thing that can be tried first is calling UpdateWindow after the first show function call.

      - ns -

      D 1 Reply Last reply
      0
      • D dj4400

        Hi all, I am using SetLayeredWindowAttributes in order to create an outlook like message. I have a special show function which moves (with SetwindowPos) the dialog and changes its opcaity while moving. :) The dialog fades in (both by movement and opacity change) around the system tray area, and after 3 seconds fades out. When i call the show function for the first time, all controls on the dialog (bitmap, static text etc.) appear as black boxes, until the fade in effect is done, then he controls appear properly. :confused: Consequent calls to the show function works properly - it shows the controls through all the fade in and fade out procedure. If i create a thread and call the show function from it then it works fine for the first call also. :confused::confused: I would appriciate it if someone can explain the differnece between calling the function from another thread or form the window thread, the drawing procedure of a dialog and may be offer a way to solve this problem without creating a new thread. Thanks Shimon

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        After setting the layered window style, you should call the SetLayeredWindowAttributes() funcion Immediately. Are you doing so? <blockquote class="FQ"><div class="FQA">dj4400 wrote:</div>I am using SetLayeredWindowAttributes in order to create an outlook like message.</blockquote> Also take a look at the AnimateWindow() function. I think you can achive the above effect with a single call to AnimateWindow() function.

        nave [OpenedFileFinder] [My Blog]

        1 Reply Last reply
        0
        • N Nishad S

          One thing that can be tried first is calling UpdateWindow after the first show function call.

          - ns -

          D Offline
          D Offline
          dj4400
          wrote on last edited by
          #4

          Indeed, calling UpdateWindow after the 1st call fixed the problem Thanks!

          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