|
Hey James. I don't have an answer for you, but your question has got me thinking about it and frankly I'm stumped. If you ever do get a satisfactory answer could you possibly share it here, as an article perhaps?
An idea I had was using the CDialog::m_nFlags member and checking for the WF_MODALLOOP and WF_CONTINUEMODAL flags. But that is MFC only, and the flags did not seem to be consistant between modal and modeless dialogs.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Is there anybody out there still using Visual C++ 5.) ?
I am looking for a possibility to draw animated GIF in my application. On CP there are some examples, but they are all for VC6. I do have a CPicture class which can draw BMP, JPG and GIF, but when I try to import an animated GIF in my resources, developer studio says it is not a valid GIF file. When I open this file in an explorer window I see the animated picture.
Can anyone help?
|
|
|
|
|
is there anyway i can find out the height and width of the title bar? (i noticed the sizes changed from Windows Classic mode to Windows XP mode)
|
|
|
|
|
I think what you are wanting is GetSystemMetrics(SM_CYCAPTION) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I used Shell_NotifyIcon to minimize the application to the nofitication area (system tray) and put an icon there. When the minimize button of the system menu is pressed, the dialog is minimized to the system tray. It was working perfectly until I tried to put an option in the title bar menu, which gave the possibility to choose whether or not to start the application as minimized. I save this information in a file, and read from the file on initialization.
The problem is that the application starts as minimized, but the main dialog can never be displayed when the Menu->Open is clicked from the tray menu. I guess it is restored to the previous position, and the previous position was "minimized".
Does anyone know how to overcome this problem?
Thanks in advance...
PS: my dialog is of fixed size.
CMyDialog::OnInitDialog()
{
...
if(startOnTray)
{
SetWindowPos(&this->wndNoTopMost,0,0,0,0,SWP_HIDEWINDOW);
this->Minimize2NotifArea();
}
else
SetWindowPos(&this->wndNoTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
return TRUE;
}
CMyDialog::OnMenuOpen()
{
Shell_NotifyIcon(...);
this->ShowWindow(SW_RESTORE);
}
|
|
|
|
|
I have not tried this recently, but IIRC, when Win32 first came out, the behavior of Minimized windows changed. Instead of a "real" state of being Minimized that did not affect your real X/Y position, they were moved off-screen to some really high X/Y location, and brought back when Restored. That behavior broke older applications that saved and restored their last position when they were closed down while minimized and then restarted.
When you restore your window, you should check its current position and make sure that you are being placed somewhere visible. You might have to reposition the dialog yourself. You can save your last position before being minimized and then restore yourself to that position.
You might be able to see if this is your problem by trying to restore your dialog from the menu, and then pressing <alt-space> to activate the dialog's System Menu. You can then select Move and try to use the arrow keys to being your window back into the visible screen. Be sure to use the KEYBOARD for this, not the mouse.
Peace!
-=- James
Tip for SUV winter driving survival: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
Thanks..
From the system menu, I chose move and the keyboard moved the mouse cursor, the dialog did not come into visible area. Then when I clicked close from the system menu, the messages which pop up on closing popped up centering the latest mouse location.
I think now I will try repositioning myself.
|
|
|
|
|
You might have to "move" the dialog for a long time before it becomes visible.
Be sure to trace some information in your dialog class upon handling the Move messages so that you can get an idea of what is going on with your dialog.
Peace!
-=- James
Tip for inexperienced drivers: "Professional Driver on Closed Course" does not mean "your Dumb Ass on a Public Road"! Articles -- Products: Delete FXP Files & Check Favorites
|
|
|
|
|
Hi,
could someone help me ! I would like to create multiple windows (or pages) when creating my mainframe in my Windows MFC project. How do I do that ?
With regards
Jens Christiansen
|
|
|
|
|
If you're talking about creating multiple views of your document, you can always use the splitter control. Check out the MSDN documentation[^] that has a couple sample code on this.
I Dream of Absolute Zero
|
|
|
|
|
no, actually I would like to have multiple windows filling the hole frame, as if they were created by "New Window" or "New File" in my menu.
|
|
|
|
|
Call OnFileNew function multiple times !
VikramS
|
|
|
|
|
This is working, but then I don't go through my MainFrame which is controlling my toolbars and menu's. So would it be possible to create the windows (pages) and control then in the MainFrame ?
|
|
|
|
|
What you are referring to is a multiple-document interface (MDI). Examples are bountiful.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
yes, but I would like my application to work with exact lets say 4 windows (pages) and no option to create more.
|
|
|
|
|
The number of open documents can easily be controlled.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I'm working on a project in which I need to load and install a USB device driver as part of my setup procedure. So I'm basically messing around trying to get this device installed manually, before I add it to the setup script.
I have a problem though... After my latest attempt, I get this error message in the device properties box:
"This device is not working properly because Windows cannot load the drivers required for this device. (Code 31)"
Does anyone know if there's a log somwhere or somthing which I can use to find out what exactly went wrong?
Joel Holdsworth
|
|
|
|
|
the file ist called setupapi.log and should be located in the windows directory.
Don't try it, just do it!
|
|
|
|
|
Hi
What are the advantages/disadvantages of using #define or pany precompiler directives?
Thanks in adavnce
Ram
|
|
|
|
|
The precomiler is both a blessing and a curse. It can really help you work round obstacles, but it can often have problems with compatibility with other compilers.
The main statments like #define, #ifdef, #ifndef, #endif and so on will work on any compiler. Others like #pragma once will only work on MSVC.
#define is useful in defining constants, and in activating and deactivating sections of code. However if you plan to use #define for constants, it's always better to use a global C constant instead:
const unsigned int MyValue = 100; Because the syntax checker can dig you out of problems this way. Also, try and avoid macros - use inline functions instead because again you may end up with crazy inexplicable compiler errors.
Joel Holdsworth
|
|
|
|
|
The main advantage is with proper use of the precompiler directives you can win the Internation Obfuscated C code contest
The other time you will see it is in header files, to make sure that the header isn't accidently included twice. The rule is if there is a way to do what you want without using the precompiler do it, but sometimes you don't have a choice.
If you don't know what the IOCCC is, check it out when you are prepared to be confused. Good programs will enjoy it, for the joke, the chance to learn some really stupid code, and to test the knowledge of C.
|
|
|
|
|
How to Create Process on remote server?
VikramS
|
|
|
|
|
|
To Hello,
I have a expansion card which has a connection to interrupt 15 pin of the PC.
How do I use VC++ 6.0 to detect the interrupt and do the necessary processing?
Is there any examples or articles that I can refer to?
Thanks.
S1189216G
|
|
|
|
|
Hi,
Use SDK coming with your card.
Otherwise, you should write own Windows driver using DDK.
Windows API doesn't allow working with the interruptes directly.
Sincerely Yours,
RadioShark
|
|
|
|