|
Yea, I'm not sure that is what we wanted either. Its just that I've seen this question come up quite a few times and most of the time it is a VB type person. I've even considered creating a template class to make this possible in VC++, just to permanently answer this question.
|
|
|
|
|
I have a Cstatic control in a dialog that draws something lengthy in response to a ON_WM_CTLCOLOR message. I need a way to interupt the process of drawing to do something else and resume drawing when finish. For example i need to have access to other controls and change various options and then resume drawing. Or basically how to have an accessible "stop" button while the drawing goes on, in order to interupt the drawing.
Is there a way without thread ? or any similar example ?
Thanks
Pierre
maurizot@canl.nc
|
|
|
|
|
Solution: don't do any lengthy processing when handling messages. Especially messages that will be generated while painting. If you don't follow this rule, your application will quickly become painful to use.
Move whatever lengthy processing you're doing in WM_CTRLCOLOR to somewhere else. Draw onto an off-screen bitmap, save the results of your calculations, whatever. Then just use the cached data during message processing. Once this is done, you'll have enough flexability to move the processing into a separate thread if necessary.
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
I want to send messages to toolbar button to be clicked automatically. I can do that with normal buttons but how can I do that with toolbar. I can get the handle of window by the same old SPY++ technique.But i cant get the button in toolbar. So how can i send a click message to button of a toolbar if i have handle of toolbar and buttons XY location.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
The buttons on a toolbar are part of the control, not individual controls themselves. So, you must send messages to the toolbar control. There are messages meant to change the state of an individual button if you wish it to look pushed (don't remember off the top of my head, check MSDN), but if you just want to fake the effect of the button getting pressed, you can just send a WM_COMMAND message to the window's owner, including the ID of the specific button.
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
Thanks. But I dont have the control ID and secondly I am out of process. So I cant send NM_CLICK messages to buttons. Secondly I cant get the ToolBar nID to use with GetDlgItem.
Please Please help.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Ok, no matter what you're trying to do, it'll be easier if you can determine the command ID of the specific button. Since i don't know what you're doing, i can't really suggest anything other than using Spy++ to watch the messages sent when you press the button.
Once you have the command ID, you can activate the function by simply sending the toolbar's owner a WM_COMMAND message.
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
Well thanks a lot. I really appreciate your help. I think I have solved the problem. Here is the procedure.
I get XY of button when user releases mouse over the button.So I also get the Handle to toolbar.To click on button i need handle of button that i can get through
gChildHwnd=::ChildWindowFromPoint(gHwnd,m_stBull.m_point);
this way I get its handle and then send messages WM_LBUTTONDOWN and WM_LBUTTONUP.This works just fine and clicks on the button.Thanks again for your support.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
How do i make a true DOS program that can be run in DOS (not in a dos shell like MS-DOS but when you boot the computer into DOS)?
And can i still use libraries like stdlib and iostream or do i need an entirely different approach? I dont so much need an answer for Visual C++ but more in general...
Thanks
Kuniva
|
|
|
|
|
First of all you need a DOS compiler, VC++6 can't create DOS executables. When you have the right compiler, you can use all its features.
|
|
|
|
|
Depends the operating system.....
If you are using Win98 or win95, when you boot in DOS mode, you are using the Kernel, in that mode you can use a console project, but if you are using a operating system like MSDOS, you need a old compiler like Turbo C or the Visual C++ 1.0
Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
I suggest that you get a copy of Turbo C++ for DOS. It's a free download from Borland's site
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Just found this site. It has lots of stuff for MSDOS
http://www.programmersheaven.com/
|
|
|
|
|
Hi.
I have release one MFC program at my website. I am prepare a second program. In both cases, users that do not have the correct Visual C++ install with the right version of MFC dll cannot run the programs. I have tried compiling a "shared" and "static library" MFC program properties. Users not not having the correct version of MFC dlls on their system cannot run the programs.
What is the best solution such that any user with or without the required MFC dll can run any MFC programs?
Thanks,
Kuphryn
|
|
|
|
|
You're allowed to redistribute the MFC dll. There is, however, no reason why a statically linked program should load the MFC dll - are you *sure* that is the problem ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Yeah. The program was compiled using the "static library" property for the *release*. The reason I could not get Visual C++ to include the MFC dlls inside the executable was because I have set the static library property for the debugger.
Here is my website with the programs I have been working on. I want to thank everyone for giving me pointers to problems and giving me solutions to more difficult ones.
http://www.dslextreme.com/users/kuphryn/
Thanks so much!
Kuphry
|
|
|
|
|
Just link MFC statically and you'll be fine
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Yeah. The program was compiled using the "static library" property for the *release*. The reason I could not get Visual C++ to include the MFC dlls inside the executable was because I have set the static library property for the debugger.
Kuphryn
|
|
|
|
|
Hi folks-
I have a CMDIChildWnd based class that has a lot of controls on it. All these controls are "hand-coded". I create them in response to WM_CREATE, resize them in response to WM_SIZE. I am not using a dialog resource for it. (The controls change at runtime based on the state of the application, therefore I dont want to use the Dialog resource)
One problem is: I have lost the ability to tab/shift-tab between the child controls. I have used the WM_TABSTOP style on all the child controls.
After searching all nite in google,cp,cg,msdn,etc..I cant find a way to do it . Can anyone help me with this ??
Thanks-
Vivek
|
|
|
|
|
If you call IsDialogMessage for your window, that function will do the dialog control processing for your window. If the message turns out that it is not related to dialog controls, it will automatically call your WindowProc for you.
You should do this in the message pump, or even in the pretranslate message. The point is, you do not want to dispatch the message if you send it to this function.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
kilowatt-
Thanks a lot !!
-Vivek
|
|
|
|
|
Hi, I dont know how to find out:
is my CDialog in foreground already?
is my CDialog partly visible or completly covered by other application(s)?
Thx for help
|
|
|
|
|
BOOL CMyDialog::IsForeground()
{
if(GetForegroundWindow() == this)
return TRUE;
return FALSE;
}
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
GetForegroundWindow(), thx!
mea culpa for not finding this in MSDN, must been blind.
Any idea how to find out if a window is (at least) partly visible - or completly covered by other windows?
|
|
|
|
|
I have never tried this before in C++, anyone know some api calls (not MFC)?
Thanks
|
|
|
|