c tout bete, mais je sais pas comment faire. ou plutot lui dire a quoi comparer sa progression par rapport au chargement de quelque chose.
mon code :
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
LRESULT CALLBACK DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hDlg);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_COMMAND:
switch(HIWORD(wParam))
{
case BN_CLICKED:
switch(LOWORD(wParam))
{
case IDC_ABOUT:
MessageBox(hDlg,"Programme d'echange de liste\nRéalisé par Xcept\nCompilé et écris en C++ avec VC++\nghostoflove@caramail.com","About",0 + MB_ICONASTERISK);
break;
case IDC_CANCEL:
DestroyWindow(hDlg);
break;
}
}
break;
default:
return FALSE;
}
return FALSE;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
HWND hdlg;
MSG Msg;
InitCommonControls();
hdlg = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC) DlgProc);
SendMessage(GetDlgItem(hdlg,IDC_PROGRESS1),PBM_SETRANGE,0,MAKELPARAM (0, 100)); //tiré de MSDN online
if(hdlg == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hdlg, nCmdShow);
UpdateWindow(hdlg);
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}