|
I agree with Chris. I was surprised looking over some
of my bathroom reading materials that the JAN 2002
edition of Windows:: Developer has in big bold letters
at the top of the cover "Disabling Ctrl+Alt+Delete on
Win NT/2000". What were they thinking?
|
|
|
|
|
I need that, without that I would not be able to program under windows...
I create programs that are used to move machine prototypes (www.tamelectromecanica.com), if I can't prevent the user to modify anything in the OS, the machine would not be as safe as it should...
1. My OS loads automatically and loads automaitcally my apps.
2. I have a System wide keyboard and mouse hook in order to prevent something to be done whilst the application is being loaded and when it is loaded also.
3. I must avoid the user to be able to exit my app.
4. I need to be able to avoid Ctrl Alt Del in order to prevent the user to shut down the PC in an incorrect way, to load any other app. or to do anything that would not be allowed for the right care of the machine.
I'm agree that in most cases handling this is stupid and that could be used in order to write viruses and other things, but in my case, its needed...
NOTE:
Imagine that one of those machines would cost 300000$, and that one user gets fired, if the user knows anything about computers, he/she could make the machine crash and it would be a great pain for the machine owner.
|
|
|
|
|
to Joan Murt:
Is it just the cosiderations about "is is good or bad to block ctrl+alt+del" or you have some original solution?
I would be appreciate very much if you share this solution.
Sorry for my bad english.
|
|
|
|
|
That was only a consideration, but in order to keep the security in the OS, the only way to do it in NT based OSes is using a GINA.DLL...
Is needed to do it in that way: that cannot be reached from any program in order to prevent malintetioned users to capture passwords and so on...)
At least this is what I know...
Hope this helps.
|
|
|
|
|
InMSDN I've found the descriptions of the following bugs, which may occur when using third-party GINA.dll:
System Policies May Not Work with Third-Party GINA DLLs
ID: Q163215
· Loss of Desktop After Logon When Using a Filter Gina.dll
ID: Q189290
· Access Violation in Winlogon with Third-Party Gina.dll
ID: Q180854
MSDN tells to download ne SP(NT 4.0 Service Pack (4.0)).
Do you know about them, and how to take care with them better (except prompting user to download this SP)?
Any suggestions?
|
|
|
|
|
Sorry, but as I make numerical control machines, I can choose the OS that the industrial PC has installed, then I use Win2k and I don't have this problem.
I don't know nothing about that, but if we think about the program requirements... you can require the SP4 to be installed in order to let your app. to run.
If you are writting a legal app. this shouldn't be a problem, and I'm not sure about that, but in your installation you should be able to check it and you should be able to launch the sp4 installation (I think it's legal to redistribute the sp's (I'm not sure about this last sentence)).
Hope this helps.
|
|
|
|
|
|
Thank you a lot for such an information! I'll try it out.
|
|
|
|
|
I can not get my Toolbar.bmp (256 colors) to display proprerly. I am using Brent Corkum's http://www.codeproject.com/menu/bcmenu.asp?forumid=150&select=170880[^] XP toolbar and Menu class.
I am so disparate, I am making my whole MDI project/workspace (VC++ 6.0 sp5) available to download just so I can solve this problem.
I am thinking about making this years version of JoeSwammi MLB free anyway because I am not to pleased with my progress. Please no comments about my coding habits/logic
The program will not work for you because there are many elements that are taking care of with the installation script which is not necessary to solve my problem.
1) You will need Speech SDK 5.1(69606 KB).
http://download.microsoft.com/download/speechSDK/SDK/5.1/WXP/EN-US/SpeechSDK51.exe[^]
although it is not totally necessary, if you wish to eliminate all the corresponding code and project settings to get it to compile. This is not related to my toolbar problem
2) run this registry entry[^](this is normally done by the installation program) it is not necessary but you will get an error upon execution of program but you will be able to see to messed up tool bar.
3) Download my workspace/project[^].
you may have to manual paste in your browser to get the file to download. It is encrypted .zip file
this is the key to unlock
(note my CP notifications have been quite delayed lately so I must manually check and see who responded )
thanks a whole lot. Hopefully it is just something stupid I am missing.
ps. this message will self destruct in a day or two.;P
pps. I just edited it not deleted it. Thanks!! MAAK!!
Later, JoeSox www.joeswammi.com The only thing that saves us from the bureaucracy is inefficiency. An efficient bureaucracy is the greatest threat to liberty.
Eugene McCarthy
|
|
|
|
|
As I understand, your problem is that the 256 colors toolbar bitmap is shown using only 16 colors. If that is the problem then this is the solution.
Firstly add your 256 toolbar bitmap as a bitmap resource, let its ID be IDB_MYTOOLBAR .
Then in the CMainFrame class (or the Child Frame class if it's a child's toolbar) declare an image list object, let it be CImageList m_ToolBarImages , after doing that go to the CMainFrame::OnCreate and write this code after the creation of the toolbar.
m_ToolBarImages.Create(16, 15, ILC_COLOR8 | ILC_MASK, 3, 3);<br>
CBitmap bmp;
bmp.LoadBitmap(IDB_MYTOOLBAR);<br>
m_ToolBarImages.Add(&bmp, RGB(192, 192, 192));<br>
m_wndToolBar.GetToolBarCtrl().SetImageList(&m_ToolBarImages);
This code should set 8bits or even 24bits buttons to the toolbar with no further procedure, hope it could help you.
|
|
|
|
|
you don't even know how much sleep I have lost over this!
Thank you!! it works great!!
Later, JoeSox www.joeswammi.com The only thing that saves us from the bureaucracy is inefficiency. An efficient bureaucracy is the greatest threat to liberty.
Eugene McCarthy
|
|
|
|
|
1. string s1 = "First", s2 = "Second".
How can I append the strings in a way that s1 is partially overwritten. for example: s1.append(s2, 1) ===> "FSecond.
s1.append(s2, 3) ===> "FirSecond".... Something like that
2. I must comment - Manipulating strings in C++ is quite hard in comparison to Java. A good API reference may considerably help on this issue. I couldn't find my way in MSDN Can you recommend an alternative? (does CodeProject have one to offer? )
|
|
|
|
|
First declare variables:
CString s1="First";
CString s2="Second";
s1=s1.Left(3) + s2;
A. Riazi
|
|
|
|
|
I have done this:
struct s_Person{
char Letter1 : 10,
Letter2 : 10,
Letter3 : 12;
}Person[5];
What I want to do is have a string of 4 chars ( which is 32 bits ), and set the first 10 BITS of the string to be letter 'a' or something else...
The struct fails because it says that the field types are too small.
How do I put a character(or characters) into the first 10 bits of a string of 4 lenght??
Also, if the data field is only 10 bits, which is 2 chars + 2 bits, the maximum I could actually fit into Letter1 would be 2 letters..Is this right??
Thanks,
grahamoj.
|
|
|
|
|
|
As stated above a char is 8 bytes. You are trying to use 10 out of 8 bits.
Below is an alternative (actually 3-in-one):
struct s_Person
{
union
{
char A[4];
struct
{
char a;
char b;
char c;
char d;
};
unsigned int name;
};
};
If you want to set the string to "ABCD", you could use:
s_Person p;
p.a = 'A';
p.b = 'B';
p.c = 'C';
p.d = 'D';
p.A[0] = 'A';
p.A[1] = 'B';
p.A[2] = 'C';
p.A[3] = 'D';
p.name = 'DCBA';
The last one might look odd, but the byte order is because Intel has a little-endian architecture.
Anyway, the total size of the structure is 32 bits.
/moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
As you know int takes 4 bytes in memory (in Win32), we can use union to do it for us.
union _Person
{
char Letters[4];
int dummy;
} Person[5];
OK, now you want to assign 10 bits to your Letters (for example 11 0101 0101 or 0x355).
<br />
Person[0].dummy=0x355;<br />
after using above code, Letters have this values:
Person[0].Letters[0]=0x55
and
Person[0].Letters[1]=0x3;
Problem solved.
A. Riazi
|
|
|
|
|
OK I think I understand it. But one thing I am confused about is where did u get 0x355,0x55 and 0x3.
I think 0101 0101 is 5 bits each, so a total of 10 bits. Is this right??
So is 0101 0101 in hex form 0x55?? So where did u get 0x355??
And does these bits work the exact same way with ints??
Thanks,
grahamoj
|
|
|
|
|
grahamoj wrote:
I think 0101 0101 is 5 bits each, so a total of 10 bits. Is this right??
No! each takes 4 bits. 0= 1 bit, 1= 1 bit. so 0101 0101= 8 bits.
grahamoj wrote:
So is 0101 0101 in hex form 0x55??
Yes.
grahamoj wrote:
So where did u get 0x355??
I use 10 bits (0x355 = 0011 0101 0101), then we need (actually) 12 bits. For this situation, 1.5 charachter required. OK, Because we have not any data type to store 1.5 character, we use 2 characters instead.
I define a union:
union _Person
{
char Letters[4];
int dummy;
} Person[5];
when we set dummy, we also set Letters. Any bytes of dummy take one byte of Letters.
If you look on C books, you will find useful information about union and it's benefits.
A. Riazi
|
|
|
|
|
BTW, the type (except for signed/unsigned) is ignored for fields. The following are all exactly the same:
struct s_Person { char Letter1 : 10, Letter2 : 10, Letter3 : 12; };
struct s_Person { short Letter1 : 10, Letter2 : 10, Letter3 : 12; };
struct s_Person { int Letter1 : 10, Letter2 : 10, Letter3 : 12; };
struct s_Person { signed Letter1 : 10, Letter2 : 10, Letter3 : 12; };
|
|
|
|
|
Is there a standard most programmers try to follow when assigning a version to their applications?
For instance... I notice a lot of "newer" applications use a 4 digit field separated by commas. If this is a "standard", what is the meaning of each of the fields?
I poked around a bit this morning, but haven't found anything yet. Before I get too carried away in a 2 or 3 hour search, I usually post a question here, as this forum has been an amazing resource for me.
Thanks in advance.
|
|
|
|
|
It's a goog question and it have been discussed a few times, here on CP, over the years.
I guess people just do it as they want to. As far as I remember most people agree'd that the first is major version, and the second is minor version and the last is build. The third I cant remember...
Like 1.2.0.77
version 1.2 build 77
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
i don't know if there's a standard. but, i do it like this:
A.B.C.D
for applications:
A = major revision. there's a good chance that most of the interface and/or internals will be new
B = update . a new major feature has been added. this is the kind of feature that i would list on the product's web page.
C = minor update . a minor feature was added. this might be just a new check box or option in a drop down somewhere.
D = bug fix.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
thanx, i was also looking for the same stuff
|
|
|
|
|
Thanks everyone, It looks like I've got my answer! no standard
I suppose I might as well throw in my own usage.
In the past I've only used three fields, and here's how they've been defined...
Ver A.B.C
Where
A = Major "Generic"... a generic is a set of defined features.
Not all features of a Generic have to be present in the initial release.
B = A subset of the generic that pulls in more of the defined features.
C = Bug Fixes
Example...
The initial release of a product would be 1.0.0, and might include 6 of 10 major features that are targeted for that Generic. 1.1.0 might include 8 of 10 features, and 1.2.0 all features.
Along the way, you would have bug fix releases that would increment the third field.
Just my two cents.
|
|
|
|