Has made idle time Dialogbox.
But I can not understand where a mistake.
If dialogue is started and at this time to close the application.
The mistake jumps out. (the PC).
Thanks.
But I can not understand where a mistake.
If dialogue is started and at this time to close the application.
The mistake jumps out. (the PC).
- Code:
short Dialog_box(ClassEDisplay *display,char* str_cap,char* str_msg,int tp_box,int dW=180,int dH=150)
{
short res=0;
MSG msg;
Back_fon.BltFast(0,0,&display->buffer,NULL);
for (int x=0;x<mW/2;x++)
for (int y=0;y<mH/2;y++)
Back_fon.PutPixel(x<<1,y<<1,0);
while (res==0)
{
display->buffer.Clear(0);
display->buffer.BltFast(0,0,&Back_fon,NULL,EFX_OPACITY,200); //,EFX_OPACITY,220
.......................
.......................
switch(tp_box)
{
case 1:
if (Button(display,Dx+dW/2-70,Dy+dH-30,&img_butons,&r) )
res=DIALOG_BOX_BUTTON_YES;
SetRect(&r,34,20,34+68,40);
if (Button(display,Dx+dW/2,Dy+dH-30,&img_butons,&r) )
res=DIALOG_BOX_BUTTON_NO;
break;
default:
if (Button(display,Dx+dW/2-15,Dy+dH-30,&img_butons,&r) )
res=DIALOG_BOX_BUTTON_YES;
break;
}
if (res==0)
{
display->Flip();
bRet=GetMessage(&msg, (HWND)hWnd, 0, 0);
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return res;
}
Thanks.
