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. Cancel dialog question

Cancel dialog question

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
3 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.
  • N Offline
    N Offline
    nm_114
    wrote on last edited by
    #1

    I have a cancel dialog for an operation that takes a while. The problem is when, in the loop, I try to change a Static control's text on the cancel dialog, it doesn't seem to erase its background (if it's showing a long file name and then a short one, the end part of the long one is still showing). I found workarounds like calling InvalidateRect on the parent dialog, but it causes a lot of flickering... I'm using the following code to process messages while in the loop:

    	`MSG msg; 		while (PeekMessage((LPMSG) &msg, (HWND) NULL, 0, 0, PM_REMOVE)) 		{ 			if (!IsDialogMessage(m_hDlgWnd, (LPMSG) &msg)) 			{ 				TranslateMessage((LPMSG) &msg); 				DispatchMessage((LPMSG) &msg); 			} 		}`
    

    Is there anything i'm missing? (I'm not using MFC or anything) - thanks

    B 1 Reply Last reply
    0
    • N nm_114

      I have a cancel dialog for an operation that takes a while. The problem is when, in the loop, I try to change a Static control's text on the cancel dialog, it doesn't seem to erase its background (if it's showing a long file name and then a short one, the end part of the long one is still showing). I found workarounds like calling InvalidateRect on the parent dialog, but it causes a lot of flickering... I'm using the following code to process messages while in the loop:

      	`MSG msg; 		while (PeekMessage((LPMSG) &msg, (HWND) NULL, 0, 0, PM_REMOVE)) 		{ 			if (!IsDialogMessage(m_hDlgWnd, (LPMSG) &msg)) 			{ 				TranslateMessage((LPMSG) &msg); 				DispatchMessage((LPMSG) &msg); 			} 		}`
      

      Is there anything i'm missing? (I'm not using MFC or anything) - thanks

      B Offline
      B Offline
      Blake V Miller
      wrote on last edited by
      #2

      Why not invalidate the static control itself. After setting the new text you want.

      N 1 Reply Last reply
      0
      • B Blake V Miller

        Why not invalidate the static control itself. After setting the new text you want.

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

        Blake V. Miller wrote: Why not invalidate the static control itself. that was one of the first things I tried - didn't work :(

        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