|
Hello all, maybe someone can help me with this:
I'm writing a program that displays a dialog box with a progress meter and a "cancel" button. The main thread creates the (modeless) dialog box, then starts the calculation. While it is doing this the dialog box is unresponsive, so I added a function that uses
while(PeekMessage(..))
to do message processing for the dialog. It is *more* responsive, but not as much as other progress dialogs I've seen in other programs. Is there a better way to do the message translating/dispatching so that it works quicker (ex: right now if you drag the window it takes 5 seconds for the window to actually move). I'm using straight API, no MFC.
Thanks to any who can help me
- J Woltman
|
|
|
|
|
I have had a similar problem and I have seen this type of questions asked a couple of times at least in the CodeGuru forum. One thing that makes a difference is your requirements. Your description does not say much about the processing being done. So I will describe a few possibilities in some general terms.
The best solution is to use the MFC "worker thread" / "user-interface thread" solution. See the MFC documentation for that.
If you are not using any MFC GUI stuff or any other MFC stuff that needs the CWinThread class and such then you might be able to create a thread with the Windows SDK. You could use an event to signal the thread that the cancel button was pressed.
Another possibility is to modify your processing so that it can be done during idle processing. See CWinApp::OnIdle and:
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_idle_loop_processing.htm
That is the online copy of something you have on your hard drive.
|
|
|
|
|
You may also take a look at PJ Naughter's PStat article on this same site.
Cheers,
Paolo
|
|
|
|
|
Does anyone know how to use GetTextExtentExPoint and all similar functions to print WYSIWYG? I tried changing the mapping mode to MM_LOENGLISH, MM_ANISOTROPIC, MM_ISOTROPIC, but it did not work. For some reason font metrics are different Even though the mapping mode of the printer and monitor are the same.
PS. I wrote my own HTML print engine, it works great. The only problem is this. Let me know if you want the code.
Thanks, Italo S Weiss.
|
|
|
|
|
Actually i want to take data from the pci card. I have no idea how to generate interrupts and access PCI BIOS in VC. does anyone guide me for the VxDs.
|
|
|
|
|
Foremost, you need the DDK from Microsoft.
Another good invesment is to puchase the VToolsD commercial device driver development toolkit. It helps with the development of VXD and NT device drivers in C. A different toolkit from the same company is used to make the WDM type drivers.
They really are time savers.
Otherwise, you spend a LOT of time doing things on your own.
There is a book about writing VXD and device drivers in C, but I don't remember the exact title.
|
|
|
|
|
Hello Stupid,
If u don't know how to write VXD's then don't try to take PANGA with PCI port. Stupid ppl do like u. I advise u to leave the idea of taking PANGA with pci. Just work with Parallel or serial port. U deserve only for it.
O.K,
Bye Bye
|
|
|
|
|
I have dll with two objects. One is CommBand and another is Browser Helper Object. How can i get pointer on my BHO object from my CommBand object ?
|
|
|
|
|
Hi!
I want to select a folder in ::SHBrowseForFolder dialog. For this, I select a folder in the callback function of ::SHBrowseForFolder in this way:
static int __stdcall BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
if (lpData) {
CFolderDlg* pFolderDlgObj = (CFolderDlg*)lpData;
if (uMsg == BFFM_INITIALIZED) {
if (!pFolderDlgObj->GetStartFolder().IsEmpty()) {
::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)(LPCTSTR)(pFolderDlgObj->GetStartFolder()));
}
}
}
return 0;
}
ulFflags of BROWSEINFO I set to zero!
It works perfect for local and mapped folders. But when I try to select an UNC path like \\bo-pc\test\xyz, it dosn't work. If I select this folder in the browser dialog once, then it works. It works also, when I close the dialog and start the dialog again. Only after close the application, the selection dosn't work any more!
Who knows something about this problem ????
|
|
|
|
|
please tell me
i don't speak english.
thank you very much for you
|
|
|
|
|
I want to change the Titletext of my MainFrame at startup.
Now I use SetWindowText(...) but this only takes effect when I click on my menu (I dont know why).
But I want the text written at startup.
Does anyone know what I am doing wrong?
Thank you...
|
|
|
|
|
Hope This will Help
void CFAdhlyView::OnDraw(CDC* pDC)
{
CFAdhlyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDoc->SetTitle (_T("Set The title here"));
}
|
|
|
|
|
Override CFrameWnd::OnUpdateFrameTitle(). This is a virtual function, but undocumented, so you'll need to add the prototype yourself. When this function is called, call SetText() to set the frame window caption.
The default implementation is in winfrm.cpp, line 1746. You can check that out to get an idea of what you can do with the function.
|
|
|
|
|
MFC uses two parts for a window title composed of a "frame window title" followed by a "document name", but the frame window title is used only if the FWS_ADDTOTITLE Frame-Window Style is set.
See: http://support.microsoft.com/support/kb/articles/q129/0/95.asp for the Microsoft Knowledge Base article "INFO: Format of the Document Template String" that describes how to modify the windowTitle and docName strings; that might be relevant for you.
The document name can be changed using CDocument::SetTitle.
|
|
|
|
|
anyone knows how to program a anti-virus program or a program that does mirroring on hard disk?
please reply to markang0007@hotmail.com, sources needed urgently...
|
|
|
|
|
Hi,
i have a few questions about developing unicode application using different input locales.
I am using Windows NT English version
First what i have done:
- i added japanese as a new input locale
- i changed the compiler and linker settings to unicode
Questions:
How is it possible to enter japanese characters into an edit field? Switching the locale in the systray doesn't
have an affect to the input to the field. Do i have to install anything else? Do i have to install an IME? if so,
where can i get it. Does this only works with an NT Japanese version?
Where can i get same more information about IME and input of characters like japanese or arabic etc.
At least, enter japanese chars into an internet explorer entry field works after switching the locale. An
additional window pops up where i can select different input modes.
TIA, Chris
|
|
|
|
|
Dear Developer
I'm developing webbrowser using CHtmlView.
And i want to control browser's scroll bar in my application.
But this works are very hard for me.
Please help.
Is there any sample code?
Thanks
dooly
|
|
|
|
|
Have a look here....
http://www.codeproject.com/miscctrl/usemshtml.asp
This file should do it, otherwise email me.
|
|
|
|
|
Hi
Thank you for your reply.
This is great information for me.
Thnaks again
from dooly
|
|
|
|
|
Hi,
I wrote a screensaver for WinNT. In the Dialog, where you can make the difference settings, there should be a
CFileDialog where you could select the files that are showed. But CFileDialog asserts. I know that I shouldn't
use MFC in this case and I should use GetOpenFileName. Can someone give me a sample code who to
use that method when you want that the FileDialog can select more than one file and how to get all selected names?
Thanx,
Grit
|
|
|
|
|
Hi,
I have a tree control that fills the entire client area of a dialog box. I want to catch the left mouse button
being pressed in the tree. The problem is, I can't catch WM_LBUTTONDOWN because the tree fills the whole dialog.
So, when the user presses the left mouse button he is not pressing it in the dialog, he is pressing it
in the tree. As a result, I am trying to make use of PreTranslateMessage. What I was wondering
was how do I detect when the the user has pressed the left mouse button while holding down
the shift key in PreTranslateMessage(MSG* pMsg)? Also, is there an easier way to do this?
Thanks Mike
|
|
|
|
|
You get an NM_CLICK notification when the user clicks in the tree. As for the keyboard, call GetKeyState(VK_SHIFT) to tell if Shift is pressed.
|
|
|
|
|
|
Hi,
I have a tree control that fills the entire client area of a dialog box. I want to catch the left mouse button
being pressed in the tree. The problem is, I can't catch WM_LBUTTONDOWN because the tree fills the whole dialog.
dialog. So, I am trying to make use of PreTranslateMessage. What I was wondering was how do I detect when
the the user has pressed the left mouse button while holding down the shift key in PreTranslateMessage(MSG* pMsg)?
Also, is there an easier way to do this?
Thanks Mike
|
|
|
|
|
Anyone know of one or two GOOD books on programming MFC for WindowsCE (versions 2 and/or 3)? I have
the WinCE toolkits installed with MS VC6. There seems to be quite a few differences between MFC on a PC and WinCE.
I've checked amazon.com, but there doesn't appear to be any books worthwhile buying. Lots of stuff on
non-MFC programming though.
|
|
|
|