相关疑难解决方法(0)

win32 内容已更改,但除非移动窗口,否则不会显示更新

我的 win32 GUI 内容每秒都会更改,但除非手动移动窗口,否则不会显示更新。我尝试每秒弹出一个消息框来触发窗口刷新并且它起作用了。因此,这证明我的内容确实发生了变化,但窗口没有更新。我希望刷新窗口而不是每次都弹出消息框,有没有这样的窗口功能?谢谢

case WM_PAINT:


RECT fingerprintSection;
fingerprintSection.left=500;
fingerprintSection.top=300;
fingerprintSection.bottom=540;
fingerprintSection.right=660;

    wmId    = LOWORD(wParam);
    hdc = BeginPaint(hWnd, &ps);

    refresh=!refresh;
    if((start==true)&&(refresh==true)&&(stop!=true))
    {       

    windowName = MultiByteStringToWideString(name1, CP_ACP);
    LoadAndBlitBitmap(windowName.c_str(), hdc,500,0);//loading a picture that doesnt change
    fingerprint();
    LoadAndBlitBitmap(TEXT("outresized.bmp"), hdc,500,300);//loading a picture that constantly change
    refresh=!refresh;

//RedrawWindow(hWnd,&fingerprintSection,NULL,RDW_INTERNALPAINT|RDW_VALIDATE|RDW_UPDATENOW|RDW_NOCHILDREN);

InvalidateRect( hWnd, &fingerprintSection, TRUE );
    }
    EndPaint(hWnd, &ps);
    break;
Run Code Online (Sandbox Code Playgroud)

c++ winapi refresh win32gui

3
推荐指数
1
解决办法
6351
查看次数

标签 统计

c++ ×1

refresh ×1

win32gui ×1

winapi ×1