Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:46:52+00:00 2026-05-22T14:46:52+00:00

I have used Visual Basic 6 in the past (LOONG ago), and it had

  • 0

I have used Visual Basic 6 in the past (LOONG ago), and it had a control called PictureBox where you could just draw stuff to, get a device context if you wanted, etc. I’m now trying to find out how to have a similar “control” in pure GDI/WinApi (no MFC, .net, atl, gdi+, etc). I was using an owner-draw button control, but you can’t (easily) get the mouse coords when it is clicked, so I figured I needed some other control. I tried a static control, but that one has no owner-draw support. I tried handling WM_PAINT, but, as far as I know (after googling for hours), there is no way to use it to update just one area of the client or just a single HWND.

So, what I’m asking is, how do people animate or blit select areas of a window, be it a control or whatever, using pure GDI and Windows API? I know MFC has something called subclassing, but since MFC is just a wrapper for Windows API there MUST BE a way to do this without it (also as I said earlier, MFC is not an option).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:46:53+00:00Added an answer on May 22, 2026 at 2:46 pm

    In all honesty, i think this may be a bit of a big project for you to take on right now. You may want to try a few simpler projects using the windows api before trying this, but i’ll give you a bit of an explanation anyway.

    You’re going to need to create a custom control. Using an existing control for this is bad practice because that’s not how they were intended to be used. To create a custom control, you first need to create a window class with WNDCLASSEX or WNDCLASS.

    WNDCLASS: http://msdn.microsoft.com/en-us/library/ms633576
    WNDCLASSEX: http://msdn.microsoft.com/en-us/library/ms633577

    Once you do that and set all the member values that you need to, you have to register the class with either RegisterClass or RegisterClassEx.

    One of the members of the WNDCLASS(EX) objects takes a window procedure function pointer. Any window created with this window class will use this window procedure.

    Once you have registered your window class, you can create a window using the window class you have made. Just do CreateWindow(…, “YOUR WINDOW CLASS HERE”, …);

    Now, your window procedure should look something like this:

    LRESULT CALLBACK MyDrawProcedure(HWND hwnd, UMSG uMsg, WPARAM wParam, LPARAM lParam)
    {
        switch(uMsg)
        {
          case WM_PAINT:
          {
            // Handle painting your control here.
          }
          break;
    
          default:
             return DefWindowProc(hwnd, uMsg, wParam, lParam);
        }
    
        return 0;
    }
    

    Well, i hope this helps a bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used traditional version control systems to maintain source code repositories on past
I had a question regarding the split function used in Visual Basic. As of
I have recently used Visual Basic .Net to write a particle system which emits
I used to have this code in Visual Basic: rpt.ParameterFields.GetItemByName(RowDate).AddCurrentValue CDate(2010-03-19) and I cannot
I have used Visual Studio 2008 ASP.NET AccessDataSource Wizard to generate the update command.
Question ONE: I'm still pretty new to .net, but have used Visual Studio for
I am new to Java (and Eclipse) but I have used .NET (and Visual
I have successfully used the Excel and Word addin templates in Visual studio 2008
As far as I remember, Visual Studio (both 2008 and 2010) used to have
I have been using Visual Studio Express versions. I used to use the full

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.