|
Look for WM_POWERBROADCAST
and return BROADCAST_QUERY_DENY
<br />
case WM_POWERBROADCAST:<br />
MessageBox (hWnd, "Colsing Why, We've just met ","System CLosing??",0);<br />
return BROADCAST_QUERY_DENY;<br />
Cheers
It is Illogical to define an inventor by his invention
|
|
|
|
|
I would like to encyrpt the contents of my program before I write them to a file. How do I go about encypting the data before I write it to a file, (at the minute I am using serialization). One limitation is that I don't want to serialize the data to a temporary file and then encrypt the file as if the unencrypted file still exists then the data is not secure.
Could someone please just get me started, as I am not sure where to look as many encryption tutorials on this site encrypt and decrypt a file that already exists, I want to encrypt data in memory and write it to a file encrypted, then read the encrypted data back into the program's memory.
Thanks a lot
|
|
|
|
|
>> then the data is not secure.
secure from what? Depending on the definition of "secure" it can be almost impossible to accomplish.
>> many encryption tutorials on this site encrypt and decrypt a
>> file that already exists
Ok but at least one of them encrypts the data in memory and then writes it to the file. So that would show you how to do it yes?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
If it's sufficient to just encrypt plain text data, you could encrypt your CString s before writing them out and after reading them in.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Start by reading Applied Cryptography. Otherwise you will miss something subtile about encryption and get no benifit.
|
|
|
|
|
Hi Dear..
Do You Know How to insert Combo & other control in DataGrid...
I"m using vc++6..
Thanks...
---Sumit Kapoor---
|
|
|
|
|
I have a MonthCalCtrl control in a dialog box. I want to set the daystates for the Month Cal Ctrl, the thing is I have a CArray of COleDateTime objects, and I'm not sure how to best set the daystates. Should I respond to the MCN_GETDAYSTATE message, and just update the visible months, or is there a way to set all of the daystates (visible or not) in the CDialog::OnInitDialog() function?
Any suggestions welcome,
Thanks
|
|
|
|
|
>> I'm not sure how to best set the daystates.
That would be dependant on the use model for your application.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
is there any way to draw in CRichEditView? OnDraw() is not called either by framework nor after a call to Invalidate(). any ideas? thanks in advance.
|
|
|
|
|
Hi!
I currently write an application as a server that translate user uploaded office files into html or pdf. I write it in VB now, but I am also a VC coder.
My trouble is office will pop up dialog and wait for user to response sometimes. I trace the problems and do some prepare to make it not pop up. But I think I can't trace all the reasons to make office pop up. Is there any solution to make office work without asking question? I can accept it dont process on some file, but can't accept it stop working and have to press a button by human.
If there isn't such a solution. I think I have to use another "police" server that kill the application and recreate a new process when the application seems blocked and don't work for a long time.
I really wanna an elegant solution. Can any guru give me some suggestion?
|
|
|
|
|
hi all
if you want to hear my problem briefly
it's that i have created a rich edit box in my
dialog and now i cant put text in it properly
is there a function or i should do it by first taking its DC(device context) .
lots of thanks you kind professional
|
|
|
|
|
Add Vairable of CString type with ur rich edit Box by Class Wizard ..
then assiagn ur trext to its CString variable.
then use
UpdateData(FALSE);
i.e.
m_strVariable = " My Text ";
UpdateData(FALSE);
i hope u will get it n it works
thanx
zahid
|
|
|
|
|
ramtinbahal wrote:
i have created a rich edit box in my
dialog and now i cant put text in it properly
is there a function
Create a CRichEditCtrl member variable and then use SetWindowText() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks for your simple response
but now i'm trying to put text in a rich edit control
while accessing the way i put it there .
i mean how i can put text at a line number and a column i wish (example line 5 column 20 ) ?
setwindowtext() is good for one line rich edit
but i have a multiline rich edit box .so i need a way to write text in it
how i wish .
Strangely there is no function in rich edit class to do it (except SetWindowText() ) or maybe i dont know because i searched MSDN entirely but nothing found .
lots of thanks
|
|
|
|
|
SetWindowText() can be used, but you'll either need to call GetWindowText() , or have the text stored in a separate buffer. For example:
CString strBuffer1;
...
strBuffer1 = strBuffer1 + "\r\n" + ...
m_edit.SetWindowText(strBuffer1); The other way would look like:
CString strBuffer2;
m_edit.GetWindowText(strBuffer1);
strBuffer2 = strBuffer1 + "\r\n" + ...
m_edit.SetWindowText(strBuffer2); You can also use ReplaceSel() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
realy thank you david
it did work .
i was going to be realy disappoited with microsoft .
but you saved them
good luck
|
|
|
|
|
realy thank you david
it did work .
i was going to be realy disappoited with microsoft .
but you saved them
good luck
|
|
|
|
|
I have hyperlink that is more than 50 character
when I specify it as the following to launch the outlook
CString str_content = "click here";
ShellExecute( NULL, "Open", "mailto:my@domain.com?Body=" + str_content, NULL, NULL, SW_SHOWNORMAL );
If i have shorter str_content and I launch, I can see hyperlink in
my outlook. However, if str_content becomes longer just text displayed in outlook content with all hyperlink code.
How can i get the hyperlink in outlook when i have longer string.
777
|
|
|
|
|
never mind i resolve the problem.
I write to a email file ****.eml and launch the file.
instead of handling everything in memory.
Thanks
777
|
|
|
|
|
A member has tell me: FindFisrtChangeNotification can help me detect a file has been modified on my Computer.
Yeah, but now i wanna know that who has performed a task on my Shared Folders (his is on my Lan NetWork) : " who is the person has pasted the file on my Shared Folder???" or "which computer has done that task???"
Help, Help, Help me.....
(Sorry , my English is not well)
thanks
thanks
|
|
|
|
|
Hi,
Hope this helps
Retrieving the owner of a file requires:
obtain the security descriptor for the file, Use GetFileSecurity()
then using the security descriptor to get a pointer to the owner's Security Identifier (SID). GetSecurityDescriptorOwner()
Finally, you use the owner's SID to obtain the owner and domain name of the file LookupAccountSid()
Cheers
It is Illogical to define an inventor by his invention
|
|
|
|
|
thanks, could you give me a simple example???,
i've tried but it's not resposible:
CString TheFile;
TheFile=CString(Buffer[i].FileName).Left(Buffer[i].FileNameLength / 2);
SECURITY_DESCRIPTOR sd;
DWORD sob;
GetFileSecurity(TheFile,OWNER_SECURITY_INFORMATION,&sd,sizeof(sd),&sob);
SID pOwner;
BOOL OwnerDefault;
GetSecurityDescriptorOwner(&sd,(PSID*)&pOwner,&OwnerDefault);
char AccountName[80];
char DomainName[80];
DWORD cbDomain;
DWORD cbName;
LookupAccountSid(NULL,&pOwner,(LPTSTR)AccountName,&cbName,(LPTSTR)DomainName,&cbDomain,NULL);
::AfxMessageBox(AccountName,0,0);
help me please???!!!
thanks
|
|
|
|
|
When a multiplayer game server outputs commands to your computer, where do they go? Is it possible to catch and log them?
|
|
|
|
|
It depends on the protocol used.
Run Network monitor and view the activity on your machine. Then save captured data to cap files.
It is Illogical to define an inventor by his invention
|
|
|
|
|
void OnButton1Click()
{
CMenu*t=GetMenu();
t->EnableMenuItem(0,MF_BYPOSITION | MF_DISABLED);
}
when i clicked the button1, the menuitem didn't change to disable. it just change to disable when i put the mouse pointer above it.
So please show me the way to change the menuitem to disable when i press the button1.
thanks...
|
|
|
|