|
the trick is making your computer believe that your application is a screen saver, that way, no other application can run.
I did this in VB some time ago. I suppose it won't be very difficult to port it to VC++
Go to the MSDN and look for this article
HOWTO: Block CTRL+ALT+DEL and ALT+TAB in Windows 95 or Windows 98
|
|
|
|
|
Francisco, I am happy with your answer. I will do as you suggest but if i will get ne problem i will mail you in this post. Okay.
--------------------------------------------------
Say Whatever You Know
Manish
--------------------------------------------------
|
|
|
|
|
Dear I want to write application which work in 98/2000. so your article is for 98 and it works fine in 98 but what about 2000.
--------------------------------------------------
Say Whatever You Know.
Helping other people is good for health.
=========
Manish
=========
---------------------------------------------------
|
|
|
|
|
In Windows 2000 you have mucho more control on the priorities of the different processes (look at the post by Paolo Messina).
I tried once (in Windows 2000) to place the seti process at realtime priority, and I can tell you it did exactly that. I could do nothing more that use that application. No switching, no mouse (keyboard still works), no paging, the closest thing you'll ever see to a real time OS in Windows.
|
|
|
|
|
> But i have no choice of using different OS.
Then you have but one choice AFAICT, write it as a kernel-mode (ring 0) driver and turn off interrupts. Don't expect to make any friends or ship such a horrible hack though.
You are _either_ Real-Time or Windows, it's *impossible* to have real-time demands in windows (even for device-drivers not turning off interrupts).
Perhaps your hardware is either designed to be driven by a real-time "something" or it's mis-designed to be used in a preemptive OS?
|
|
|
|
|
Have you tried to use SetThreadPriority() and SetPriorityClass() with THREAD_PRIORITY_TIME_CRITICAL and REALTIME_PRIORITY_CLASS respectively?
(If you do, don't forget to restore default priority when you don't need that anymore).
Maybe that could help, but as others said Windows is not a real-time OS.
I think that's the best you can do in a user-mode application.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
I'm currently testing my project on Windows ME and have found the following problem: I'm using a SDI project using the Doc/View architecture. Using the code at the bottom of this post i'm drawing rectangles on to the screen. When redrawing the screen (Most often when I've got an Invalidate() command in the MouseMove Handler), after a certain number of redraws (A different number each time), suddenly lose the color from my blocks and just get a black outline. I have absolutely no idea why this happens, could somebody help me?
Thanks in advance,
- X
The Code (This is placed in a function and called for each block I need to draw):
CBrush br;
CRect rect;
rect.left = point.x - BLOCKWIDTH/2;
rect.top = point.y - BLOCKHEIGHT/2;
rect.right = point.x + BLOCKWIDTH/2;
rect.bottom = point.y + BLOCKHEIGHT/2 - NODELENGTH;
// I'm writing a Flow Chart application, so the following line draw
// little 'nodes' at the top and bottom of each block
pDC->MoveTo(point.x, point.y + BLOCKHEIGHT/2 - NODELENGTH);
pDC->LineTo(point.x, point.y + BLOCKHEIGHT/2);
br.CreateSolidBrush(RGB(0,200,0));
pDC->SelectObject(&br);
pDC->Rectangle(rect);
br.DeleteObject();
|
|
|
|
|
Select the brush out of the device context before destroying the brush.
CBrush* pOldBrush = pDC->SelectObject(&br);
pDC->Rectangle(rect);
pDC->SelectObject ( pOldBrush );
br.DeleteObject();
--Mike--
http://home.inreach.com/mdunn/
your with and
|
|
|
|
|
FillSolidRect is better because you pass in the brush as a parameter, instead of having to select it in and out.
pDC->FillSolidRect(&rect, RGB(255,0,255));
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I'm now trying to learn template classes, and I have some questions...
Is it possible to create abstract template classes?
If it is, how do I inherit from them?
And how do I create an instance of a template class, let's say for one instance for 'int' and another for my own class 'MyClass'?
Sprudling
|
|
|
|
|
It is poosible to create abstracet template classes (just give it a try
You inherit from them as you would a normal class.
template<class t="">
class CBaseClass
{
//ex:
virtual int DoIt() = 0;
....
};
template<class b="">
class CDerive : public CBaseClass
{
};
//an instance:
CDerive<int> MyIntclass;
shouldn't be all that difficult?
|
|
|
|
|
Hi,
I've some doubt in templates. what Happens if we have a static variable in a template base class. and we pass two different parameters while instatiating it.
is the static "variable Single" or does each instance has its own diffrent variable
|
|
|
|
|
There's a difference between instantiating a template class (making a template class into a concrete class) and instantiating an object of a class.
|
|
|
|
|
How do we make a template class into a concrete class
|
|
|
|
|
Can anyone direct me to a place where I can find a quality example/tutorial on creating a 2000\NT service?
|
|
|
|
|
http://www.codeproject.com/system/index.asp#Services
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Why doesn't this work:
SYSTEMTIME sysTime;
sysTime.wHour = 22;
sysTime.wMinute = 34;
SetSystemTime(&sysTime);
|
|
|
|
|
Probably because other fields are invalid. Try initializing the structure properly before using it. FYI, you can call GetLastError() to figure out why SetSystemTime() failed.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi..
Could anyone lend me a hand... How do u play sound files other than wav files? The source codes that I have can only play wav files, however I need to be able to play MID, MP3, and other sound files.
Thanks in Advance. CIAO
|
|
|
|
|
I've tried your suggestion but there is one problem!
The timer has to be killed BEFORE OnTimeChange() calls.....
so what to do... kill the timer in the OnTimeChange is to late because the variable in OnTimer assigns the time to the time that the user changed to!
so how??
Do you have any suggestions?
|
|
|
|
|
You said to me before that poledit.exe could disable the time change in Windows.
Now I wonder: Can you guide where to check or uncheck the the option that enables time changing!
What .adm file am I going to use?
|
|
|
|
|
Well, I said that maybe PolEdit could have that option. I never used it, sorry, I only know it can be used to configure some restrictions on Win9x machines (such as disabling the screen settings).
Try with a search on Google for "poledit", maybe you'll have better luck!
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hey!
I have two questions about MSVCRT.DLL.
1. I am compiling an ActiveX control in VC++ 6. When I choose the min_dep build settings, I can a linker error: "symbol not found _main()" or something like that. The help suggests that I remove the _ATL_MIN_CRT preprocessor define - but if I will do that, the project will depend on MSVCRT.DLL - and I don't want that.
2. Suppose for a moment that I have to live with the dependancy on MSVCRT.DLL. With which OSes / common applications is it distributed? I tried to package it with my ActiveX DLL in the same CAB (without any .INI file) - and the control didn't start - this small red X appeared on the top left corner of its deisgnated area in the page. On the computer I tried that, I actually HAD the MSVCRT.DLL installed. When I tried doing the same with a CAB file that didn't contain MSVCRT.DLL inside it - it worked. (As I said, MSVCRT.DLL was in my system directory all along). I'm using Windows 2000 Server - no SPs. Anyone has an explanation for that?
Thank you!
|
|
|
|
|
MSVCRT is distributed with a ton of stuff, since it is the C runtime and all. However you can build your control in ReleaseMinDependency mode and the CRT code will be linked statically, meaning you won't need that DLL. This makes life much easier on you, since you don't have to worry about which version of the DLL is on the system, and installing a new one if necessary.
--Mike--
http://home.inreach.com/mdunn/
Trillian: What are you supposed to do with a manically depressed robot?
Marvin: You think you've got problems. What are you supposed to do if you are a manically depressed robot?
|
|
|
|
|