Hello Everyone.
I am relatively new to gui programming with win32. I have a question about using resources with the pelles editor.
I know how to draw a progress bar using the following
hWndProgressBar = CreateWindowEx(
0,
PROGRESS_CLASS,
(LPSTR)NULL,
WS_VISIBLE | WS_CHILD| PBS_SMOOTH,
36, // x
141, // y
100, // width
14, // height
g_Windowhandle,
(HMENU)MainProgress,
(HINSTANCE)GetWindowLongPtr(g_Windowhandle, GWL_HINSTANCE),
NULL);
if (!hWndProgressBar)
MessageBox(NULL, "Progress Bar Failed.", "Error", MB_OK | MB_ICONERROR);
SendMessage(hWndProgressBar, PBM_SETRANGE, 0, MAKELPARAM(0, 20));
SendMessage(hWndProgressBar, PBM_SETSTEP, (WPARAM)5, 0);
If I were to just draw a progress bar using the pelles editor, how do I tap into it? The functions seem to want a HWND. If there some registration function I need to use?
Thanks.
//suppose elsewhere in h file
#define DLG_MAIN 1001
#define IDC_PROGRESS 1002
.........
//in code
hWndProgressBar = GetDlgItem(DLG_MAIN, IDC_PROGRESS);
SendMessage(hWndProgressBar,........
//or
SendDlgItemMessage(DLG_MAIN, IDC_PROGRESS,........
Thank you very much Lamer!
That was way easier than I thought it was going to be. ;D