|
i want to get a unique sign as the encryption code~
but i doubt there do not have the unique sign to specific the certain Floppy Disk.
who have the idea?
|
|
|
|
|
The best solution I can think of is to use the serial number of the floppy disk. It's meant to be (fairly) unique.
The reason why the "unique" serial numer exists is, AFAIK, the only way for the floppy driver (in the OS) to find out that the diskette has been replaced in the floppy drive, and hence, the directory structure has to be reloded by the driver/OS.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
i kown this way. OS can allocate a serial number to the diskette by format.
but if two OS format the diskette can set the same serial number?
i am not sure~
|
|
|
|
|
Yes, that's why I wrote "fairly" unique.
The serial number is just 4 bytes long (32 bits).
But if you want a more unique number, You could create a file on the diskette, and use the time stamp for that file.
Combine the time stamp of that file with the diskette serial number, then you will have a more unique number.
Would that solution be good enough?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
thanks~
this way looks like a compromise.
|
|
|
|
|
Well, it isn't the ideal solution.
But if you want to have an encryption key on the diskette itself (without violating things), this is one way to go.
Else, I guess you could make the diskette bootable and then overwrite a part of (one of) the boot files (IO.SYS or MSDOS.SYS) with the decryption key.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
hi,
i have a dialog created in my application i saw in one website the coding snippet for a creation of bitmap button.
They have used the constructor for initiallization.
It goes like this:
Use the constructor to load the bitmaps of each button:
CGeomeSheet::CGeomeSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)<br />
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)<br />
{<br />
m_psh.dwFlags |= PSH_NOAPPLYNOW;<br />
<br />
AddPage(&Quad);<br />
AddPage(&Circ);<br />
AddPage(&G3D);<br />
<br />
btnBmpOK.LoadBitmaps(IDB_OK_DEFAULT, IDB_OK_SELECTED,<br />
IDB_OK_FOCUS, IDB_OK_DISABLED);<br />
btnBmpCancel.LoadBitmaps(IDB_CANCEL_NORMAL, IDB_CANCEL_SELECTED,<br />
IDB_CANCEL_FOCUS, IDB_CANCEL_DISABLED);<br />
btnBmpHelp.LoadBitmaps(IDB_HELP_NORMAL, IDB_HELP_SELECTED,<br />
IDB_HELP_FOCUS, IDB_HELP_DISABLED);<br />
}
i need to know how they hav used CPropertySheet in the constructor for the default base class to be CDialog???
how to chose CPROPEERTYSHEET as base class ne 1 plz help me!!!!!!!!
zari
|
|
|
|
|
zareee wrote: how to chose CPROPEERTYSHEET as base class
Using menu Insert-->Insert class .
|
|
|
|
|
Hello,
I want to know is there any method to distinguish among file and folder?
|
|
|
|
|
if u r using MFC then use CFileFind or FindFirstFile(Win32 API)
never say die
|
|
|
|
|
I have tried using CFileFind::IsDirectory() method.
But can you guide me with any method in C++, i have to identify file or folder provided in string format.
|
|
|
|
|
tony1-udz wrote: with any method in C++,
Did you mean not using MFC ?
What about PathIsDirectory ?
|
|
|
|
|
Is SetCurrentDirectory helpfuls?
|
|
|
|
|
GetFileAttributes. A folder will have FILE_ATTRIBUTE_FOLDER, a file will not.
(I hope I remember the constant name correctly).
|
|
|
|
|
hii ,
Can somebody help me ..
For the buttons on the toolbar how can we give the effect as highlighted when pressed or when the mouse is move on it .
Thanks
Shikha
"If there is a will there is a way"
|
|
|
|
|
You can use SetState() method of CButton Class and set the parameter as TRUE to highlight the button
Abhijeet
|
|
|
|
|
Hi
Abhijeet r u from AEC Chikhli.
Regards
Atul Mahajan
Atul Mahajan
|
|
|
|
|
No,
I am from Amravati.
& graduated from Shegaon engineering College.
Abhijeet
|
|
|
|
|
Thanks Abhijeet,
But for the toolbar buttons ,setstate() is not suitable.
Regards
Shikha
"If there is a will there is a way "
|
|
|
|
|
1. Use TB_HOTIMAGELIST message to set the "hot" image list of toolbar
2. Subclass the toolbar and implement the WM_MOUSExxx, WM_NCMOUSExxx etc. messages to detect toolbar buttons activation, mouse hovering etc. and you can do whatever you like to do. For example you can use DrawEdge to draw a button margins when hovered.
|
|
|
|
|
im using a CColorDialog to get the numbers of a color but i cant figure out how to set it as a number it keeps setting it as €€€ the return of CColorDialog is formatted as 128128128 i need it as 128 128 128 i can get it that far i just cant figure out how to write it without it changing to €€€.
|
|
|
|
|
<br />
COLORREF temp = RGB(20,155,10);<br />
int red = (temp & 0x0000ff);<br />
int green = ((temp >> 8) & 0x0000ff);<br />
int blue = temp >> 16;<br />
char str[100];<br />
sprintf(str,"red %i green %i blue %i",red,green,blue);<br />
<br />
output :
red 20 green 155 blue 10
Hope this helps
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
that part i can do but when i try to write it to the registry it changes it from numbers to extended char set.
|
|
|
|
|
save it as a string in the registry
sprintf(thestring,"%i %i %i",iRed,iGreen,iBlue)
will format the stirng -> 155 155 155
then you dont have to warry about extended chars?
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
thats what im trying to do
RegSetValueEx(hKey, "Background", 0, REG_SZ, (const unsigned char *)"0 78 152", dwvalue);
that works fine but when i get the color from the dialog is when it kicks me in the head
COLORREF color;<br />
CString c;<br />
DWORD r, g, b;<br />
if (m_check3.GetCheck() == 1)<br />
{<br />
CColorDialog dlg;<br />
if(dlg.DoModal()== IDOK)<br />
{<br />
color = dlg.GetColor();<br />
r = GetRValue(color);<br />
g = GetGValue(color);<br />
b = GetBValue(color);<br />
}<br />
c.Format("%d %d %d", r, g, b);<br />
hKey = HKEY_USERS;<br />
path = ".DEFAULT\\Control Panel\\Colors";<br />
DWORD value = color;<br />
MessageBox(c);<br />
DWORD dwvalue = sizeof(DWORD);<br />
RegOpenKeyEx(hKey, path, 0, KEY_ALL_ACCESS, &hKey);<br />
RegSetValueEx(<br />
hKey,<br />
"Background",<br />
0,<br />
REG_SZ,<br />
(const unsigned char *)&value, <--- here<br />
dwvalue<br />
);<br />
}
|
|
|
|