////////////////////////////////////////////////////////////////////////////////
// TrackTest.c
#include <Windows.h>
#include <CommCtrl.h>
#include "resource.h"
INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
int APIENTRY WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG), NULL, DialogProc);
return 0;
}
INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static HWND hProg, hTrack;
INT_PTR retval = TRUE;
int iPos;
switch (uMsg) {
case WM_INITDIALOG:
hProg = GetDlgItem(hDlg, IDC_PROGRESS1);
hTrack = GetDlgItem(hDlg, IDC_TRACK1);
SendMessage(hProg, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
SendMessage(hTrack, TBM_SETRANGE, 0, MAKELPARAM(0, 100));
break;
case WM_HSCROLL:
iPos = SendMessage(hTrack, TBM_GETPOS, 0, 0);
SendMessage(hProg, PBM_SETPOS, iPos, 0);
break;
case WM_CLOSE:
EndDialog(hDlg, IDOK);
break;
default:
retval = FALSE;
}
return retval;
}
////////////////////////////////////////////////////////////////////////////////
// resource.h
#define IDD_DIALOG 100
#define IDC_PROGRESS1 1000
#define IDC_TRACK1 1001
////////////////////////////////////////////////////////////////////////////////
// TrackTest.rc
#include <windows.h>
#include "resource.h"
IDD_DIALOG DIALOGEX 0, 0, 320, 200
STYLE WS_POPUPWINDOW | WS_MINIMIZEBOX
EXSTYLE WS_EX_APPWINDOW
CAPTION "TrackTest"
FONT 9, "MS Pゴシック"
BEGIN
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",
WS_BORDER,20,8,284,16
CONTROL "Track1",IDC_TRACK1,"msctls_trackbar32",
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,20,36,284,16
END
Ly8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL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