ProgressBar (Отобразить)
CODE:
#define GWL_HINSTANCE -6
#define WS_VISIBLE 268435456
#define WS_CHILD 1073741824
#define PBM_SETRANGE 1025
#define PBM_SETPOS 1026
#define PBS_SMOOTH 1
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll");
external(INT, "GetWindowLong", "GetWindowLongA", "User32.dll");
int histance, progress_bar1, progress_bar2;
createdialog(0);
showdialog(0, "Dialog", 300, 300, 400, 200, 1, 1);
for(int i=0; i<100; i++)
{
sendmessage(PBM_SETPOS, i, 0, formatiw(progress_bar1));
sendmessage(PBM_SETPOS, i, 0, formatiw(progress_bar2));
sleep(30);
}
function getmessage(0, WM_CREATE)
{
histance=GetWindowLong(gethwnd(0), GWL_HINSTANCE);
progress_bar1=CreateWindow(0, "msctls_progress32", "", WS_VISIBLE | WS_CHILD, 10, 10, 310, 25, gethwnd(0), 0, histance, 0, 0);
progress_bar2=CreateWindow(0, "msctls_progress32", "", PBS_SMOOTH + WS_VISIBLE | WS_CHILD, 10, 50, 150, 25, gethwnd(0), 0, histance, 0, 0);
sendmessage(PBM_SETRANGE, 0, 0+100*65536, formatiw(progress_bar1)); // минимальное и максимальное значение (от 0 до 100)
sendmessage(PBM_SETRANGE, 0, 0+100*65536, formatiw(progress_bar2));
}
#define WS_VISIBLE 268435456
#define WS_CHILD 1073741824
#define PBM_SETRANGE 1025
#define PBM_SETPOS 1026
#define PBS_SMOOTH 1
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll");
external(INT, "GetWindowLong", "GetWindowLongA", "User32.dll");
int histance, progress_bar1, progress_bar2;
createdialog(0);
showdialog(0, "Dialog", 300, 300, 400, 200, 1, 1);
for(int i=0; i<100; i++)
{
sendmessage(PBM_SETPOS, i, 0, formatiw(progress_bar1));
sendmessage(PBM_SETPOS, i, 0, formatiw(progress_bar2));
sleep(30);
}
function getmessage(0, WM_CREATE)
{
histance=GetWindowLong(gethwnd(0), GWL_HINSTANCE);
progress_bar1=CreateWindow(0, "msctls_progress32", "", WS_VISIBLE | WS_CHILD, 10, 10, 310, 25, gethwnd(0), 0, histance, 0, 0);
progress_bar2=CreateWindow(0, "msctls_progress32", "", PBS_SMOOTH + WS_VISIBLE | WS_CHILD, 10, 50, 150, 25, gethwnd(0), 0, histance, 0, 0);
sendmessage(PBM_SETRANGE, 0, 0+100*65536, formatiw(progress_bar1)); // минимальное и максимальное значение (от 0 до 100)
sendmessage(PBM_SETRANGE, 0, 0+100*65536, formatiw(progress_bar2));
}