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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. a newbie-ish question about windows programming

a newbie-ish question about windows programming

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorialannouncementlearning
3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I am writeing a windows program that runs a file i/o function that takes a while to run, and I can't figure out how to make it update the programs window while it is running the funtion. How do I get it to run the window's window procedure in the middle of the function? (I think that is what I have to do..) This is probably a really easy thing to fix, but I can't figure it out. BTW this is a dialog based program (a dialog made in the resource editor) if that makes any difference.. Any help would be greatly appreciated. Thank You.

    H 1 Reply Last reply
    0
    • L Lost User

      I am writeing a windows program that runs a file i/o function that takes a while to run, and I can't figure out how to make it update the programs window while it is running the funtion. How do I get it to run the window's window procedure in the middle of the function? (I think that is what I have to do..) This is probably a really easy thing to fix, but I can't figure it out. BTW this is a dialog based program (a dialog made in the resource editor) if that makes any difference.. Any help would be greatly appreciated. Thank You.

      H Offline
      H Offline
      HP
      wrote on last edited by
      #2

      Hi! Put the following function into your dialog class and call it in the file i/o loop. This will ensure that the window messages are correctly disptached. void CYourDialog::PumpMessages() { static MSG msg; if( GetSafeHwnd() != NULL ) { while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { if( !IsDialogMessage( &msg ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } } } } HTH Holger Persch

      J 1 Reply Last reply
      0
      • H HP

        Hi! Put the following function into your dialog class and call it in the file i/o loop. This will ensure that the window messages are correctly disptached. void CYourDialog::PumpMessages() { static MSG msg; if( GetSafeHwnd() != NULL ) { while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { if( !IsDialogMessage( &msg ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } } } } HTH Holger Persch

        J Offline
        J Offline
        Jon
        wrote on last edited by
        #3

        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