|
The reason why the taskbar matters, or any appbar for that matter, is because of the available workspace area. There is desktop size, which is the size of your resolution, and the workarea that is the space that is available to a maximized window.
You can determine the amount of availble workarea by the ::SystemParametersInfo function.
BTW, WTL provides a lot of great support for basic window manipulation, and it even has a dialog resize class that I have used for property sheets.
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!
|
|
|
|
|
With SystemParametersIfo can I set a new workspace area?
If so, could this mean that I would be able to resize everything without worrying if the taskbar is visible or not?
That would be great for me...
sorry about my next 2 questions but...
1. could you send a little example of how to do this? (if its possible to do it and you don't mind helping me...)
2. I've listened a lot about WTL,ATL,STL... where can I find general information about those libraries? I'm curious about them...
|
|
|
|
|
First of all tahnk you for your reply!
Paul Watt wrote:
Yes, but let me ask a question? Are you centering windows and stuff, because I was not really clear what kind of issues that you are seeing with your MoveWindow calls. The most important thing that I have learned is that the Workarea value should be used when you are centering windows because there may be other appbars present, not just the windows taskbar.
There must not be any problem with that in my case...
I'm making apps that are used in order to control machines with numerical controls, and my apps start from a service at the very beggining and I avoid the user to reach the OS with system wide keyboard hooks.
Then what I need is to be capable to resize and move windows using always the same method, and as I developed a class for it, what could be better than being able to do the same work not depending on the state of the taskbar...
The kind of issues that I've seen are:
- Incorrect positioning of buttons when they should be placed where the taskbar area is.
- Window positioning incorrect after moving it to get the full screen.
I'll try to set the new workspace area getting the monitor resolution and then try to resize the windows that should maximize using only pWnd->ShowWindow(SW_SHOW_MAXIMIZED);
NOTE:
I'll take a look at msdn in order to document myself about those libraries.
|
|
|
|
|
Thank you for your reply again!
I've been trying to correct my functions and it has worked all OK after using SystemParametersInfo...
The only thing that could be better is that if I use ShowWindow(SW_SHOWMAXIMIZED) the window flickers, first it gets positioned in the normal workarea, and after that it gets automatically positioned over all the screen.
But after two days thinking and getting mad about that I'm so happy, I have been able to solve this...
I was really getting mad...
Thanks again!
|
|
|
|
|
HI, I have a normal MDI applications with several views. I want that some of these views should always be on top, even if one view below these ontop views is activated. Is that possible at all to have an activated view below a non activated one?
Thanks, Patirc
|
|
|
|
|
One solution is to have the view call SetFocus() when applicable.
Kuphryn
|
|
|
|
|
? Any ideas.
Let's say I have a CDialog with static text and one OK button. How can
I make this compatiable with a RedHat Linux 7.0 operating system? Is
it possible? Do I need to add something to my project? Please let me know.
Any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Don't use MFC. Use a crossplatform framework like Qt[^] or wxWindows[^].
Pavel
Sonork 100.15206
|
|
|
|
|
I'm going to say that it's because MFC isn't included in Redhat Linux.
You might need to use a GUI that portable.
That's why I ramble so much. If you're short and quotable, there's a much greater danger of ending up in a sig.
[Christopher Duncan on how to prevent yourself from ending up in a sig]
|
|
|
|
|
Does someone know whether EventViewer uses an ActiveX control in order to manipulate the event logs. If so, where is it documented? I cannot find any materials about that. (My intention is to use that ActiveX control in an MFC application.)
Thanks in advance.
|
|
|
|
|
Is MASM part of VC++? If not, does VC++ have a MASM mode allowing it to assemble inline assembly code?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
assemble inline assembly code?
_asm
Ravi Bhavnani wrote:
Is MASM part of VC++?
Nope , but there is a free download of it on MSDN , version 6.1 if I recall exactly.
Cheers,Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary.-Shog9
Remember just because a good thing comes to an end, doesn't mean that the next one can't be better.-Chris Meech
|
|
|
|
|
|
MASM ships with Visual Studio .NET Professional and Enterprise editions. Or, you can download it as part of the Processor Pack on MSDN, here: http://msdn.microsoft.com/vstudio/downloads/tools/ppack/default.asp
Nick
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2002 Microsoft Corporation. All rights reserved.
|
|
|
|
|
|
button in RichEdit
How to place the button on RichEdit so that that button can work?
Thanks
|
|
|
|
|
Why would you want to place a button 'on' a rich edit control? A button placed 'on' a rich edit control would obscure part of the control's window, and would not be drawn correctly.
You should explain what you're trying to do in more detail.
Software Zen: delete this;
|
|
|
|
|
Hi everybody,
In my application i have created a simple function which delete memory of specific pointer, you could find its following code:
void LoadHistoDB::DeleteHistoNorm()
{
if(pHistoDBNorm!=NULL)
{
delete[] pHistoDBNorm;
pHistoDBNorm=NULL;
}
}
but when i call this function in debug mode, i could read in a message box this following:
"User breakpoint called from code at 0x77f8629c"
and when i try to debug step by step (with F11 ) it calls this function:
void __cdecl operator delete(void* p)
{
#if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
_free_dbg(p, _NORMAL_BLOCK);
#else
free(p);
#endif
}
and the if condition is verified so i have the message box mentionned above
so if someone could explain me where is the problem?
thans in advance
gerald
tell me if you need the whole code
|
|
|
|
|
The "user breakpoint" message usually shows up when something very wrong has happened. Chances are you are trying to delete a pointer that is junk. (Quick question, are you *sure* the pointer is ether NULL or pointing to a valid, deletable block of memory that was allocated using new [] ??)
Even a broken clock is right twice a day.
|
|
|
|
|
when you tell me about "deletable block of memory that was allocated", what do you mean about "deletable", because you could see in the following code how i allocate memory for this pointer:
void LoadHistoDB::AllocHistoNorm(long NumHisto)
{
DeleteHistoNorm();
pHistoDBNorm=new double[NumHisto];
}
do you think when you see the delete function that there is a problem?
thanks
gerald
|
|
|
|
|
What is pHistoDBNorm initialized to? (i.e. in the constructor).
If you don't initialize it to NULL in the constructor, then the first time you call AllocHistoNorm, then it will try to delete trash.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I initialize to NULL in the constructor, the problem arrive when i don't want to use pHistoDBNorm anymore i want to delete memory, and it doesn't work!!!
|
|
|
|
|
As your deleting an array, you may find that you have written beyond the range of allocated memory such as:
char *p = new char[100];
p[-1] = '\0' ; // error
p[100] = 'H'; // error
This can cause breakpoints when deallocating the memory, as in debug mode special buffers are placed before and after you allocated data to check for this kind of thing.
Roger Allen
Sonork 100.10016
In case you're worried about what's going to become of the younger generation, it's going to grow up and start worrying about the younger generation. - Roger Allen, but not me!
|
|
|
|
|
When you call DeleteHistoNorm() you check to see if pHistoDBNorm is NULL or not. The thing is that when you declare double *pHistoDBNorm, just to be safe in your class constructor you should set pHistoDBNorm = NULL. I don't know if you are using this pointer somewhere else in your source code without initializing it and then all of a sudden you try to delete it.
none
|
|
|
|
|
I've got a VC++ 6 standalone Windows app that has been relying on the screen being set in 8-bit color mode in order to do palette manipulation on its own special data display. When the screen is set in 16-bit color mode, the palette manipulations still seem to work, but when the CFont objects are created for some text display (basic 12-pt size, etc), the characters in 16-bit depth are large, ugly, and essentially unreadable. In 8-bit depth, everything looks fine. The positioning within the display bitmap is also off in the 16-bit depth.
I'm missing some key piece here that I haven't been able to identify yet, and that's where I'm looking for some guidance. If the app creates a 12-pt font in 8-bit depth and uses GDI TextOut for a text string at location (100,100) in the display bitmap, things are fine.
In 16-bit depth, shouldn't it work the same way? What's the difference that causes the problem?
As always, any guidance from those who know will be most appreciated.
Thanks,
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|