最小化应用程序时进度条无法正常工作 [英] progress bar is not working properly while minimize the application

查看:112
本文介绍了最小化应用程序时进度条无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用Microsoft Visual C ++ 8进行开发.

我正在将72张图像加载到应用程序中.

我正在尝试进行过程时显示进度条,即在加载图像且正在进行此过程时,请最小化当前应用程序并最大化进度条.
这无法正常工作,意味着应用程序显示空白区域.

我从Google获得了一些信息.实现BackGroundWorker线程来解决此问题.
请帮助我在VC ++中实现线程.

在此先谢谢您.

Hello all,

I am using Microsoft visual C++ 8 for development.

I am loading 72 images into application.

I am trying to show a progress bar while my process is going on.i.e loading images and while this is in progress, minimize the current application and maximize the progress bar.
This is not working properly and means application shows a blank area.

I got some information in Google. Implement BackGroundWorker threads to solve this problem.
Please help me to implement threads in VC++.

Thanks in Advance.

推荐答案

以下是讨论UI应用程序中线程的出色文章:
使用工作线程 [
Here is an excellent article discussing threads in a UI application:
Using Worker Threads[^]

-PaulH


你好Paul Heil,

感谢您的回复.

我将尝试实现Worker线程,但是我对此并不陌生..

如果您知道VC ++中的实现,请帮助我..

我将发布实现.

您能帮我在VC ++中实现后台工作器吗?
进度条实施:

我打开一个新对话框,为此创建了一个新类,并在对话框上放置了一个进度条控件.

以下代码已插入进度类的OnInitDialog()中.

m_Progress.SetWindowPos(&wndTop,10,1,wh-150,40,SWP_SHOWWINDOW);

这里m_Progress是进度条控制的变量.

在加载图像功能中,我插入了以下代码以显示进度栏.

m_Dlg =新的ProgDlg(this);
m_Dlg-> Create();

这里m_Dlg是Pogress bar类的对象.

ProgressBar更新:

为此,我在进度条类中编写了一个函数,并将图像索引设置为该函数.在加载图像功能的for循环中调用此函数.

m_Progress.SetPos(count);该代码用于更新进度条.
Hello Paul Heil,

Thanks for your reply..

I will try to implement Worker threads, But i am new to this..

If u know implementation in VC++, please help me..

I will post my implementation.

Can you help me to implement background worker in VC++.?

Progress Bar Implementation:

I take a new dialog, created a new class for that and placed a progress bar control on dialog.

The following code was inserted in OnInitDialog() in progress class.

m_Progress.SetWindowPos(&wndTop,10,1,wh-150,40,SWP_SHOWWINDOW);

Here m_Progress is a variable for progress bar control.

In loading images function i am inserted the following code to show progress bar.

m_Dlg = new ProgDlg(this);
m_Dlg->Create();

Here m_Dlg is object for pogress bar class.

ProgressBar updating:

For this, i wrote one function in progress bar class and set image index to that function. call this function in for loop in loading images function.

m_Progress.SetPos(count); this code is used to update progress bar.


这篇关于最小化应用程序时进度条无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆