No announcement yet.

Vc6++ Help Meeeeeeeeeee

  • Filter
  • Time
  • Show
Clear All
new posts

  • Vc6++ Help Meeeeeeeeeee

    Blah going from libSDL for graphics and windows to window's stuff isn't fun...I started work on the interface for my relay controller and I'm having problems getting it do what I want.

    The app is just a dialog that shows all of the buttons to control the relays and crap...The buttons are a custom class based off of CStatic to use bitmaps. The program class is based off CDialog.

    I need my program class to be able to know when the user has released the mouse button (so it can turn the relay off.) My button class gets told when the button is up using OnLButtonUp and updates the button's bitmap fine...any idea why my main class won't recongnize the same?

    edit: Basically I see that when the cursor is in my static img all events go to it and nothing gets to the dialog class...can I just tell them to share with eachother and stop ****ing me off? :-P

  • #2

    Post your code.
    Progress [I will seriously never be done!]
    Via EPIA MII
    512MB RAM
    OEM GPS (embedded)
    nLite WinXP pro on
    1GB Extreme III CF card
    Carnetix 1260 startup/ DC-DC regulator
    Software: Still, re-Writing my existing front end in .Net


    • #3
      Here's the parts for the most part. I took a button example from CodeGuru and removed the shaped window part. Basically I need RelayOn called when first clicked and as soon as the mouse is released (the problem) or when the mouse moves outside the border (works fine) RelayOff gets called.

      And yes - I know the code is a mess...I'm just throwing sample code availble until I could get the basic result I want for testing.

      (also threw the listbox from the sample code back in there as it was the easiest way for a noob like me to see when it's actually getting called.)
      Attached Files


      • #4
        I stopped believing in rar in the 90s so I can't look at your code.

        But the WM_LBUTTONDOWN is only sent to the client area of the window the cursor is in. You can change this behavior by using the SetCapture function, but it will still only go to the one window you set the capture to.

        There are a number of ways to do what you want to do though. The ones I can think of off the top of my head are you can either pass a pointer to your dialog to your static class and call a member function off of it when you recieve the lbuttonup message or you can generate your own WM_COMMAND or WM_APP message, send it to the dialog window and process it there. Developer (I am Chuck)
        Get StreetDeck at
        The Official StreetDeck Forums have moved, please visit us at for official support for Streetdeck.


        • #5
          Try OnNotify() or OnChildNotify() depending on if you put it in the window or button class. Also, the resources are missing in the rar.


          • #6
            Sorry couldn't post the resources because I'm using t-mo for net access and they block larger transfers.


            • #7
              No problem. I just finally remembered the important part. Use owner draw buttons. You'll get calls to CButtonrawItem(LPDRAWITEMSTRUCT) for down, up, etc. which will make it all easier.