|
For the controls you can derive your own class from the control's class, and override OnPaint () to draw the shadow. You have to use SubclassDlgItem () in your OnInitDialog () or OnInitialUpdate () to route Windows messages to your derived class.
|
|
|
|
|
For controls you can derived your class of that classes and you will be more control on color of that controls.
|
|
|
|
|
Hi,
I posted the question of saving the bitmap to a file. initially it was not drawing. Not i am able to draw. My requirement is i should able to capture images for one minute even when the user presses clt+alt+del. i set up a timer and calling the bitmap capturing for one minute. it is working fine as long it is in focus. but when i press clt+alt+del it is failing saying invalid handle.
I am getting window handle.
after going this site, i came to know that this is a problem in xp. But how to modify my program so that it can work in 2003
http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.gdi/2004-03/0037.html[^]
Any suggestions
modified on Thursday, June 5, 2008 9:52 AM
|
|
|
|
|
Not i am able to draw.
...this must be: "NOW I am able to draw",...otherwise the question doesn't make much sense.
You don't tell us what the source is that you are attempting to capture, when the user selects the CTRL-ALT-DLT, but you could just automatically save the image to memory when it initially appears (I assume that it is being displayed in your app window), even though the user has not selected it.
The following information is from Wikipedia[^]:
"In Windows NT, and thus on its successors, including Windows 2000, Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008, this keystroke combination is recognized (as a special system-wide "keyboard hook") by the Winlogon process, which in response instructs GINA to perform one of the following tasks:
(1) If nobody is logged in, bringing up the login dialog to allow the user to log in. Also used when the computer is locked to bring up the unlock dialog.
(2) If the computer is configured as a part of a domain or it runs Windows 2000, the combination brings up the "Windows Security" dialog, where the user can lock the computer, change their password, log out, shut the computer down, or invoke the Task Manager. This is the default behavior in Windows Vista and Windows Server 2008, regardless of whether or not the computer is part of a domain. The options presented can be controlled through the use of Group Policy.
(3) If Windows XP is not connected to a domain...
and the Welcome Screen and fast user switching are turned on, Ctrl-Alt-Del directly invokes the Task Manager.
and the Welcome Screen and fast user switching are turned off, Ctrl-Alt-Del will open the Windows Security Dialog, as described above.
Windows NT is designed so that, unless security is already compromised in some other way, only the WinLogon process, a trusted system process, can receive notification of this keystroke combination. This is because the kernel remembers the Process ID of the WinLogon process, and allows only that process to receive the notification. This keystroke combination is thus called the Secure Attention Sequence. A user pressing Control-Alt-Delete can be sure that it is the operating system (specifically the WinLogon process), rather than a third party program, that is responding to the key combination, and that it is therefore safe to enter a password. It was chosen as the secure attention key in Windows (instead of, for example, the System Request key), because on the PC platform no program could reasonably expect to redefine this keystroke combination for its own purposes.
It is also a reliable method for bringing up the Task Manager (in Windows Server 2003 and older). All other keystroke combinations could potentially be exclusively tied up by a process that is stuck, but a user process is not able to intercept the Control-Alt-Delete sequence. It can be however disabled by Windows Group Policies. Ctrl+Shift+Esc also brings up the task manager in all Windows NT versions starting with NT 4.0, even if pressing Ctrl+Alt+Del is set to bring up the Windows Security dialog".
There is an article about disabling the Secure Attention Sequence, by Paul DiLascia[^], in which he explains all the important Windows System details. The answer you want is probably there.
|
|
|
|
|
Your answer was perfect I give you 5.
|
|
|
|
|
Hello,
I have a client application that uses dll.Now I want to debug this application but even if I press F11 the control doesn't
'step into' the dll porogram.
How can I get the conrol into my DLL program?
Pritha
|
|
|
|
|
Start debugging from yor dll project: open your project and press F5. VC will ask you to provide the path to the executable that uses your dll. Be carfull that the dll which is used by your exe (so, probably in the same dir as the exe) is the same as the dll you built.
|
|
|
|
|
If you want to debug your dll than open your dll workspace and use client application as an executable file.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hello,
Thanks for the replies
I tried debugging the dll but I get the following message.
"This application has failed to start because BaseClassesDLL.dll was not found."
I have the dll in the directory where I mentioned in my Settings for the client program.
Pritha
|
|
|
|
|
Is the path of DLL that you build and the DLL that is used by client application is same? Please check it.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
|
Thanks
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hi,
There are many dialog boxes in my project. I want to know that which one is active at a certain time. For example;
CDlg1 * dlg1;
dlg1= new CDlg1;
dlg1->Create(IDD_DIALOG1,this);
CWnd * wnd;
wnd = (CDialog*)GetActiveWindow();
if(wnd == dlg1)
wnd->DestroyWindow();
I wrote this code to close the window. How can I know that which wnidow is active?
Thanks
|
|
|
|
|
You can use GetFocus() Or GetForeGroundWindow() functions.
Regards,
Sandip.
|
|
|
|
|
These are not working in my situations.I think the problem is not about GetActiveWindow(). The problem is that when I want to know if this window (active window) is the same window with the dialog box that I created before, it couldn't compare them. This part has problem I think;
if(dlg == wnd)
|
|
|
|
|
iayd wrote: CDlg1 * dlg1; // A global object for the dialog box.
dlg1= new CDlg1;
dlg1->Create(IDD_DIALOG1,this);
Since you're creating your child dialogs by passing your main dialog as parent, call GetTopWindow() by passing parent window handle . It will give you the top most window of your application.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks. That solved the problem.
|
|
|
|
|
iayd wrote: if(wnd == dlg1)
Use window handles instead of MFC objects to compare. Since MFC window objects are just wrappers around window handles.
if( wnd.GetSafeHwnd() == dlg1.GetSafeHwnd() )
;;//...
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
I am using Standard SDK 500 and EVC++ to develop my UI application.
I have added an edit box to input barcode in my main dialog window.
I want to show soft input panel on my dialog when my cursor hovers over the edit box
to input barcode .
How do I do that?
Ema
|
|
|
|
|
I have a class as...
class Log
{public:
Log(string);
void InitializeLog(string);
...
class Initialize
{ public:
Initialize(string);
void ReadPropfile(string);
....
};
};<pre>
next I am doin this...
<pre>void Log::InitializeLog(string p_path_name)
{
Initialize obj(p_path_name);
obj.ReadPropfile(p_path_name);
}
void Log::Initialize::ReadPropfile(string log_path)
{....}
From the main I call...
Log obj(path);
obj.InitializeLog(path);
...
When I compile I get the following error. How do I get rid of this
test_utility.obj :error LNK2001: unresolved external symbol "public: __thiscall Log::Log(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >)" (??0Log@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@
@std@@@Z)
properties.obj : error LNK2001: unresolved external symbol "public: __thiscall Log::Initialize::Initialize(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >)" (??0Initialize@Log@@QAE@V?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@@Z)
THANKS
|
|
|
|
|
pl_kode wrote: class Log
{public:
Log(string);
forget to implement constructor for Log? Log::Log(string) ?
pl_kode wrote: class Initialize
{ public:
Initialize(string);
And Initialize::Initialize(string) too?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi,
how can I get data from edit control in a integer?
|
|
|
|
|
You can use GetDlgItemInt(IDC_EDIT1) function.
Regards,
Sandip.
|
|
|
|
|
Actually this is double value
|
|
|
|
|
What does that mean?
|
|
|
|