|
Sir,
I have written a code to enable and disable system menu close in
CMDIChindFrame Window in MDI Application. But Disable button is not getting enable in maximized state. If I change the state of MDIChindFrame Window, Close button get enable.
void CMyChindFrame::DisableClose(BOOL bClose)
{
// TODO: Add your specialized creation code here
m_bClose = bClose;
if(m_bClose)
{
CMenu *pSysMenu = GetSystemMenu(FALSE);
ASSERT(pSysMenu != NULL);
VERIFY(pSysMenu->ModifyMenu(SC_CLOSE, MF_BYCOMMAND|MF_GRAYED, SC_CLOSE,
"Close"));
}
else
{
CMenu *pSysMenu = GetSystemMenu(FALSE);
ASSERT(pSysMenu != NULL);
VERIFY(pSysMenu->ModifyMenu(SC_CLOSE, MF_BYCOMMAND|MF_ENABLED, SC_CLOSE,
"Close"));
SendMessage(WM_NCPAINT);
SendMessage(WM_NCACTIVATE,TRUE);
}
}
|
|
|
|
|
How can I make a nice Windows bluescreen which forces the user to reboot the computer (i.e. the bluescreen does not disappear with a [return]).
Nothing should be damaged. The user should just be forced to reboot his computer.
Thx
|
|
|
|
|
hi,
I am newbie in device driver development.Is it possible to develop a device driver which is application specific? I meant ,suppose I want to use a printer driver only for my application and not the whole operating system.
Is it possible?
help Help
vikram
|
|
|
|
|
No,you can't develop device driver for application specific.you can use windows API for your application.
Pradeep
|
|
|
|
|
Why? I have My own Driver and I want to use it from my application only.are u very much sure of this?
Vikram
|
|
|
|
|
Your device driver will be general to the whole PC, but the interface to control it will be of your own design. This means it would be very dificult for an external programmer who does not know this interface to use it from one of their applications.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi !!
Maybe this is an odd questions, but I'm wondering what are the real benefits of using the StringTable resource : is it only for centralizing strings ?
Thanks for your enlightements....
Jerome
|
|
|
|
|
Apart from centralization, if all your program strings are in resources, you can have these resources DLLs dynamically loaded. This means that if you had a different versiuon of the same resources in a different language, you original code will work unchanged (probably) in the new language.
This makes it very easy to internaltionalise your applications.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Thank for your answer !
But it brings me another question : the resources of my project are actually a DLL ? I never used the String Table resource in my projects, but for other resources, I never noticed any produced by the resources. Or is it an option ?
This means that such a DLL would basically just be a table of strings ?
Thanks you !
Jerome
|
|
|
|
|
Jerome Conus wrote:
the resources of my project are actually a DLL ?
Yes. In fact any resource you rapplication uses be it a string/dialog template/bitmap etc could be placed in this resource only DLL. You could then load the version of the DLL for the language you want your application to run in. It works for all resource types (even user defined ones).
See these articles, which may be of help
http://www.codeproject.com/cpp/mult_lang_support.asp[^]
http://www.codeproject.com/cpp/switch_languages.asp
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Thank you very much for the links !
Jerome
|
|
|
|
|
I have a sample that creates a file with a different extension (say.xyz)Now I need to associate an icon with this file that was created, Any idea on how to do this
|
|
|
|
|
Hello,
How can i get the Tray icon position ?
Regards,
|
|
|
|
|
Hello everyone,
I have problems with joining console app and DLL with simple non-modal dialog in it.
In DLL::InitInstance() I call Dlg.Create(IDD, NULL) and Dlg.ShowWindow(SW_SHOW) and it works.
So when I load dll in console app I can see dialog.
The problem appears after that. Dialog is simply dead. It can't ever repaint itself after overlapping. But if I show MessageBox after LoadLibrary, everything ok. Dialog is alive and can parse messages.
I thought that problem is in my console app and put Sleep() in it, but nothing changed.
Can anyone help me with it?
Thanks in advance.
|
|
|
|
|
You have to control the console's message queue.
When you call MessageBox , the message loop is created by default, offering to your modeless' messages the chance of being dispatched. But after you close the message box, the modeless is dead again, right?
If you need to use the console for input purposes - as making calls like cin - then this thread[^] might be useful.
rechi
|
|
|
|
|
Thanks for the answer.
The problem is that I don't want to control Dialog in DLL from console app. I simply would like to have independent dialog from console app. In the same DLL, where dialog is defined, I have other functions. So the only things that console app knows about DLL are those exported functions.
Is it possible to make dialog in DLL independent, to be able to use it in any application?
Best regards.
|
|
|
|
|
va`Lery wrote:
Is it possible to make dialog in DLL independent, to be able to use it in any application?
It's me again. I did some research meanwhile and... it's possible! (with a minimum of effort, calling an exported function). You have to use a modal dialog box from a worker thread created inside the dll. Unfortunately you cannot create the worker from InitInstance , so you have to do it using some exported function, after LoadLibrary call ends.
rechi
|
|
|
|
|
Hi,
Thanks for the research.
But I can't implement it due to two problems.
First of all, I can't create a dialog in a thread from the template in my dll. Only way to do it is via dll's HMODULE and ::FindResource+::LoadResource and then CreateInderect. I don't think it's normal.
Second is that after DoModal I get error message ERROR_RESOURCE_DATA_NOT_FOUND(1812). Even if I create the dialog in the DLL::InitInstance, which is possible to do with normal .Create(id, pWnd), I have the same error in DoModal.
Any ideas?
If you did it somehow, maybe you can send me an example?
And one small remark, if I use modal dialog in child thread, does that mean that my main thread will be suspended until modal dialog on a screen?
Thanks for your help.
|
|
|
|
|
Hi
How to get the numbers of the comm ports with modems (more then one) using TAPI.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello,
I am writing a dialog based application in VC++ 6.0.
In one of my dialog box, The check boxes aren't grouped right. I have four checkboxes and they need to be in groups of two. So If I check one box in one of the group the other one from the same group should be unchecked. But, as of now, you can check all 4 together at the same time, or with sometimes, the wrong button gets unchecked etc.
This may be a basic question, but I will will appreciate if you could help me with this problem. Thanks!
Sincerely,
Anjum Gupta.
|
|
|
|
|
You should use Radio buttons instead of checkboxes, otherwise, you'll have to do the mutual exclusive thing by hand.
~RaGE();
|
|
|
|
|
If you want to invent groups, the first member of your group has to be marked as 'group' in it's corresponding properties.
In your case that means that 2 radio boxes are assigned to be a group and the other 2 not. Beside that, I think the elements that belong to a group have to follow the 'group leader' (your element marked as group) in the tab order.
Sh*t ... just realized that you wanted to know sth. about check boxes .... so the post of my predecessor seems to be valid...
|
|
|
|
|
Thanks to both of you for your responses. I am using radio buttons and that Tab ordering tip was very helpful. It is working now!
Gupta.
|
|
|
|
|
He, I have a problem and not the solution !
After starting my computer (under Win2000), I would like run automaticaly my App (C++), and after the user will not access to OS (explorer, tasks manager, ...) except if the user enter the good password on App. Do you have an Idea ?
Please !
MyEden
|
|
|
|
|
Sounds like you're trying to write a logon replacement.
Look up GINA in msdn.
#include <beer.h>
|
|
|
|