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 8975151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:48:24+00:00 2026-06-15T18:48:24+00:00

I am writing a simple GUI application in Visual C++/Windows API. I have a

  • 0

I am writing a simple GUI application in Visual C++/Windows API. I have a Trackbar control on the dialogbox defined in resources as:

CONTROL "",IDC_SLIDER1045,"msctls_trackbar32",0x50010000,23,52,141,16,0x00000000

I want to show the trackbar value on static text control, so I wrote:

case WM_NOTIFY:
if(lParam == TRBN_THUMBPOSCHANGING)
{
    Pos1 = SendMessage(GetDlgItem(hwndDlg, 1045), TBM_GETPOS, 0, 0);

    wsprintf(szPos1, "Change IP address every %d minutes", Pos1);

    SetDlgItemText(hwndDlg, 1044, szPos1);
}
break;

I tried also:

case WM_NOTIFY:
    Pos1 = SendMessage(GetDlgItem(hwndDlg, 1045), TBM_GETPOS, 0, 0);

    wsprintf(szPos1, "Change IP address every %d minutes", Pos1);

    SetDlgItemText(hwndDlg, 1044, szPos1);
break;

Both codes doesn’t work. First gives no action, second hangs the application.

My question is: How to get Trackbar value and show it on static text control in real time?

  • 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-06-15T18:48:24+00:00Added an answer on June 15, 2026 at 6:48 pm

    Be sure to read the SDK documentation for Trackbar. The section titled “Trackbar Notification Messages” tells you how the control tells you about the position.

    Note how it documents that you should listen for the WM_HSCROLL or WM_VSCROLL message.

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

Sidebar

Related Questions

I'm writing simple GUI using wxPyhon and faced some problems. My application does simple
I have a rather simple multi-threaded VCL gui application written with Delphi 2007. I
We have a mature Windows desktop application written in C++. The application's GUI sits
I'm writing a simple IRC server and client GUI using wxPython. In my application,
I'm writing a simple loan calculator with gui using swing. I used DecimalFormat to
I am writing a simple Python script with no GUI. I want to be
I have been writing a small java application (my first!), that does only a
I am writing a simple GUI using netbeans and Java SE, i cannot seem
I have several simple Perl programs writing to the standard output, but this has
I'm working on writing a very simple client/server application as an excuse to start

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.