|
Hi,
In my application, I get the ID of another process, and I'd like to get all the handles owned by this extern process. Does anybody know how to proceed ?
Thanks,
Robin.
|
|
|
|
|
is there a way to set the max size that a program/dialog can open. example 800x600. my application is an mdi app.
thank you.
|
|
|
|
|
Try to catch the WM_SIZE message and from there call SetWindowPos function to set a maximum size of your frame windows
Best regards,
Alexandru Savescu
|
|
|
|
|
The WM_SIZE is sent after the size has been changed, so
you will get a flicker if you resize then.
|
|
|
|
|
If you are looking at restricting even if the user wants to resize the appilcation
to maximum size, you should not probably, in this case only dialogs can help.
But if you want a work around for this probably
indicating a thin border for your FrameWnd and explicitly
disabling the System Menu SC_MAXIMIZE might help.
|
|
|
|
|
Check WM_GETMINMAXINFO in MSDN.
Magnus
|
|
|
|
|
You will want to use the WM_GETMINMAXINFO message. The OS will send this message to your window right before it is to be resized, and this is your windows chance to tell the OS the smallest size that the user can drag the window to and the largest that they can resize the window to.
This message will also allow you to determine the maximized position dimensions. You can force a maximized window to only take up a small portion of the screen, and you can set the position of that reduced size window when the window is maximized. Look at FreeCell in the accesories folder for a demonstraction of this.
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!
|
|
|
|
|
I know the syntax of both of these functions but can't find any place in the MS literature where it states when one should be used in lieu of the other.
From what I've been able to discern with tests it appears as though I should I use SetAbortProc to handle print spooling errors and AbortDoc to handle user cancellation. Anyone know for sure?
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
You are the author of two books and are asking us for help? Will I get royalties if I answer your question? We should be emailing you with questions...
The AbortDoc method and the abort proc function are two different things. If you look at the CView::OnFilePrint() method in the MFC you can see how both are used. The SetAbortProc method is use by the print manager to set a call back function. This call back (abort proc) gets called to check if the use wants to cancel (abort) the print. If the use does then the AbortDoc method is called.
For standard MFC printing OnFilePrint method will call the abort proc between printing each page. This _AfxAbortProc(HDC, int) function will check and see if the cancel button has been pressed.
Why use SetAbortProc? The default print stuff works well for most multipage printing. But, what if your print is only one page long and takes a long time to render to the printer? You may what to create your own OnFilePrint and abort proc that will allow the user to cancel the print. Creating you own also allows you to use a custom dialog during printing. Say, one that shows the precentage complete instead of the page being printed.
Note that the abort proc also get called for internal printing errors and out-of-memory or out-of-disk conditions.
See MSDN for:
Callback Function for CDC::SetAbortProc
CDC::SetAbortProc
and MFC source Viewprnt.cpp:
CView::OnFilePrint()
class CPrintingDialog : public CDialog
BOOL CALLBACK _AfxAbortProc(HDC, int)
Hope this helps...
Good luck with the books!
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
I would like to know if someone knows (of course someone knows but...) how to place all types of fonts on a combo box. The language is Visual C++.
I can add those combo boxes but still don't know how to make them have the font types or in the second combo box the size of the text.
My project objective is to do a mini-word
|
|
|
|
|
Chris Losinger has a font combo box class on CP. Search for it
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
How do I search for that???? I'm a little rookie on this ... btw, what is CP? (go easy on me!!!)
|
|
|
|
|
Never mind... CP = Code Project (right?)
I've got it thanks
|
|
|
|
|
See this link :-
http://www.codeproject.com/combobox/FontCombo.asp
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
Geezze.... you guys are fast awsering this :p while i've been loking for it 2 posts ;D Great
Thanks for the help anyway
|
|
|
|
|
Btw, Chris Losinger has something about font size too??? If not, who does?
Thanks for all the help provided until now
|
|
|
|
|
We try our best
Michael
|
|
|
|
|
CP = CodeProject.
Type the subject into the search window at the top of any CP page.
Good luck,
Bill
|
|
|
|
|
CP = CodeProject.
Type the subject into the search window at the top of any CP page.;)
Good luck,
Bill
|
|
|
|
|
I've been trying to understand the code made by Chris (i guess its name is this one) but i'm very amateur... if someone could help a little more in this subject i would be very gratefull...
Hopping for good news and thanks for all 'till now
Stay cool :p
Phoenix
|
|
|
|
|
Hi!
My app crashes in this dll after I push my Exit button. Why? Blocked memory? ... I do nothing in the OnCancel function, just return to App class. And my app works right, no crashes.
|
|
|
|
|
Check the destructors of your objects. Also, when it crashes, click "Retry" to debug it, and get the call stack. You are likely to find where it crashes (even if it crashes in msvcrt, it is likely one of your objects that is faulty).
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hi!
I'm working with a multimedia app and I used PlaySound() function several times. It works fine, but when I close Windows 98, even 1 hour after testing my app, I get a MMTask.exe error in a white message dialog. Can anyone tell me why?
|
|
|
|
|
Hi,
Guys
I want that some of my folders are kept secured..
I mean that users are not able to open those
folders or Delete them
System : Win95 and Win98
Please help
Sameer
|
|
|
|