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. Problem with drawing using GDI functions...

Problem with drawing using GDI functions...

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelp
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.
  • R Offline
    R Offline
    Rozis
    wrote on last edited by
    #1

    I've created an application that paints on the window using GDI functions. It works fine. But because it is still under development it sometimes craches. It seems that if there are certain craches Windows Vista suddenly decides to treat my application in a new way: while drawing on the window it decides it must redraw that was on the screen when i started my application. The effect is that some drawing is lost. Windows continues with this behavour till i reboot my pc. After i booted the same piece of code draws the window correctly. I used Spy++ to find out what's happening. When the window is correctly displayed i see the following:

    <00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1215 yPos:640
    <00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1215 yPos:640
    <00039> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1249 yPos:711
    <00040> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1249 yPos:711

    (I press the mousebutton to start drawing, it draws the window, i press the mousebutton again to close the window)

    When things go wrong Spy++ reports the following:

    <00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1219 yPos:643
    <00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1219 yPos:643
    <00039> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
    <00040> 004904B2 R WM_WINDOWPOSCHANGING
    <00041> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
    <00042> 004F0646 R WM_WINDOWPOSCHANGING
    <00043> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
    <00044> 00340626 R WM_WINDOWPOSCHANGING
    <00045> 004904B2 S WM_WINDOWPOSCHANGED lpwp:0012FE20
    <00046> 004904B2 R WM_WINDOWPOSCHANGED
    <00047> 004F0646 S WM_WINDOWPOSCHANGED lpwp:0012FE20
    <00048> 004F0646 R WM_WINDOWPOSCHANGED
    <00049> 00340626 S WM_WINDOWPOSCHANGED lpwp:0012FE20
    <00050> 00340626 S .WM_SIZE fwSizeType:SIZE_RESTORED nWidth:1280 nHeight:770
    <00051> 00340626 R .WM_SIZE
    <00052> 00340626 R WM_WINDOWPOSCHANGED
    <00053> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
    <00054> 004904B2 R WM_WINDOWPOSCHANGING
    <00055> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
    <00056> 004F0646 R WM_WINDOWPOSCHANGING
    <00057> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
    <00058> 00340626 R WM_WINDOWPOSCHANGING
    <00059> 00340626 P WM_PAINT hdc:00000000
    <00060> 00340626 S WM_ERASEBKGND hdc:D1011D9A
    <00061> 00340626 R WM_ERASEBKGND fErased:False
    <00062> 00340626 S WM_GETICO

    A 1 Reply Last reply
    0
    • R Rozis

      I've created an application that paints on the window using GDI functions. It works fine. But because it is still under development it sometimes craches. It seems that if there are certain craches Windows Vista suddenly decides to treat my application in a new way: while drawing on the window it decides it must redraw that was on the screen when i started my application. The effect is that some drawing is lost. Windows continues with this behavour till i reboot my pc. After i booted the same piece of code draws the window correctly. I used Spy++ to find out what's happening. When the window is correctly displayed i see the following:

      <00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1215 yPos:640
      <00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1215 yPos:640
      <00039> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1249 yPos:711
      <00040> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1249 yPos:711

      (I press the mousebutton to start drawing, it draws the window, i press the mousebutton again to close the window)

      When things go wrong Spy++ reports the following:

      <00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1219 yPos:643
      <00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1219 yPos:643
      <00039> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
      <00040> 004904B2 R WM_WINDOWPOSCHANGING
      <00041> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
      <00042> 004F0646 R WM_WINDOWPOSCHANGING
      <00043> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
      <00044> 00340626 R WM_WINDOWPOSCHANGING
      <00045> 004904B2 S WM_WINDOWPOSCHANGED lpwp:0012FE20
      <00046> 004904B2 R WM_WINDOWPOSCHANGED
      <00047> 004F0646 S WM_WINDOWPOSCHANGED lpwp:0012FE20
      <00048> 004F0646 R WM_WINDOWPOSCHANGED
      <00049> 00340626 S WM_WINDOWPOSCHANGED lpwp:0012FE20
      <00050> 00340626 S .WM_SIZE fwSizeType:SIZE_RESTORED nWidth:1280 nHeight:770
      <00051> 00340626 R .WM_SIZE
      <00052> 00340626 R WM_WINDOWPOSCHANGED
      <00053> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
      <00054> 004904B2 R WM_WINDOWPOSCHANGING
      <00055> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
      <00056> 004F0646 R WM_WINDOWPOSCHANGING
      <00057> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
      <00058> 00340626 R WM_WINDOWPOSCHANGING
      <00059> 00340626 P WM_PAINT hdc:00000000
      <00060> 00340626 S WM_ERASEBKGND hdc:D1011D9A
      <00061> 00340626 R WM_ERASEBKGND fErased:False
      <00062> 00340626 S WM_GETICO

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #2

      That just looks like the window position is getting changed. Hard to say what may be wrong from just looking at the messages that Windows is sending your applications window. You probably need to post some of the applicable code.

      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