|
Hi,
I want to know how to programmically incorporate the XP style windows (frame, buttons, etc.) to a project in Visual C++ .NET 2003.
Beginning with Visual C++ .NET 2003, Microsoft has changed the window it incorporate window styles to a project. In older versions, an application gets the XP style under XP automatically. That is no longer true in version .NET 2003.
I have read the solution at MSDN include the one with using TheApp.exe.manifest. However, the solution requires that the program must have the manifest file in the same directory as the EXE, even in final release.
I want like to know if there is a solution to programmically incorporate the XP style windows to a project without needing the manifest file "visible" to end-users.
Thanks,
Kuphryn
|
|
|
|
|
Hi
How can I integrate my own help topics into MSDN Library (I mean into Document Explorer)
Best regards,
v0id
|
|
|
|
|
I used to be able to do this with MSVC v1.52, but don't know if it's still possible with the 32-bit compiler.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi folks,
I need to be notified when a CDialog-derived class receive a WM_KEYDOWN message. This dialog is the main window of a secondary thread (not the main application one). I can see w/ the debug trace that the message is posted by my OnKeyDown oveloaded function is never called. Any idea about this? Thanx a lot in advance.
Best Regards;)
|
|
|
|
|
Interesting.
Overload PreTranslateMessage(). Does it process WM_KEYDOWN?
Kuphryn
|
|
|
|
|
I noticed PreTranslateMessage works properly but the message is lost somewhere in between the MFC call stack. I am confident this could be due the fact there is a OCX control on the dialog that probably process the WM_.
How can I be notified of the message instead of the control(s)?
Best Regars,
andrea
|
|
|
|
|
Hey,
i want to read Vals out of a data file. Because I don't know the number of colums and rows, I need to declare the Array dynamic.
e.g. File with 500 rows and 3 colums , i tried to use this but it didn't work:
double MyArray[iRow][iColumn];
|
|
|
|
|
I'd use something like one of the collection classes, like CArray<> or even vector<>.
Steve S
|
|
|
|
|
Best of all I suggest using std::vector defined in <vector>
|
|
|
|
|
I recommend an STL container as the other members have mentioned.
Here is one solution for a two-dimensional dynamically allocated array.
int **pData = new int *[iRow];
for (size_t i = 0; i < iRow; ++i))
pData[i] = new int[iColumn];
...
Remember to deallocate memory.
Kuphryn
|
|
|
|
|
Hi Friends,
I am designing a graphical editor on which diffrent graphical object can be placed(like msword and power point). For this I require to create text control which has exactly same property as other tools provides(like msword and pwer point). I will like to know from which class I should derive my TextControl so that it can have all the property without using any third party tool.
Thanks
Is source code of ms-word for text control is available
|
|
|
|
|
CEdit? However I don't think you could hack at it enough to make it do what you want it too. Either start from scratch designing all the classes yourself, or use richedit text control or the MSHTML control and IWebBrowser2
I'm drinking triples, seeing double and acting single
|
|
|
|
|
Hello
Im using a CListCtrl and the subitems arent shown when I use the code below.
If I put the code in OnInitialUpdate everything works. What's the problem?
void CLogAnalyzerView::OnUpdate(CView* , LPARAM lHint, CObject* )
{
CListCtrl& lst = GetListCtrl();
if (lHint == CLogAnalyzerDoc::VIEW_LOADDOC)
{
CMarkup& xml = GetDocument()->GetXml();
xml.FindElem("/log");
xml.IntoElem();
while (xml.FindElem("session"))
{
int iItem = 0;
while (xml.FindChildElem("entry"))
{
iItem = lst.InsertItem(LVIF_TEXT, lst.GetItemCount(), xml.GetChildAttrib("stamp"), 0, 0, 0, 0);
if (!lst.SetItemText(iItem, 1, xml.GetChildAttrib("prio"))) TRACE("%d\n", GetLastError());
lst.SetItemText(iItem, 2, xml.GetChildAttrib("t"));
lst.SetItemText(iItem, 3, "baks");
lst.SetItemText(iItem, 4, xml.GetChildAttrib("group"));
lst.SetItemText(iItem, 5, xml.GetChildData());
}
}
}
}
|
|
|
|
|
Does the while loop get executed as expected? Do the xml.Getxxx() calls return the expected data? Are any of the calls to SetItemText() failing?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The while Loop and xml.xxx() works as expected.
SetItemText returns 0 (=fail).
If I run GetLastError afterwards it returns 0, strange huh?
|
|
|
|
|
I have had much better luck using the LVITEM structure
LVITEM lvi;<br />
ZeroMemory(&lvi, sizeof(lvi));<br />
lvi.mask = LVIF_TEXT;<br />
lvi.iItem = lst.GetItemCount();<br />
lvi.iSubItem = 0;<br />
lvi.pszText = "Test";<br />
lvi.cchTextMax = lstrlen("Test");<br />
INT nInsertPos = m_MyListCtrl.InsertItem(&lvi);<br />
<br />
<br />
ZeroMemory(&lvi, sizeof(lvi));<br />
lvi.mask = LVIF_TEXT;<br />
lvi.iItem = nInsertPos;<br />
lvi.iSubItem = 1;<br />
lvi.pszText = "Column one test";<br />
lvi.cchTextMax = lstrlen("Column one test");<br />
m_MyListCtrl.SetItem(&lvi);
|
|
|
|
|
Hello @ all!
I want to store confidental data on a system (Windows). Can you tell me where is a safe place for that?
For example when you have a shareware it saves the count how often you have opened it, where? Also if you reinstall it, the count is still stored on the system!
I want to now this because I'm writing a file encryption tool and I want to safe how often someone tries to decrypt the same file, to prevent brute force attacks.
So I need a safe place for that. File and Registry changes are easily to observe or spy. So I think this is not a good idea!
It would be great if you have some good ideas?
Best regards
Eric
|
|
|
|
|
Osborn wrote:
Can you tell me where is a safe place for that?
In reality, there is none.
Osborn wrote:
File and Registry changes are easily to observe or spy. So I think this is not a good idea!
If you are not willing to use the registry, or some form of a file, you've just limited your options to near zero.
Having said that, a file or the registry is perfectly suited to what you want, as long as you account for the human factor. Let me explain.
More often than not when folks are putting (sensitive) data into a file, it's as obvious as the nose on your face. It practically has "invite" written all over it. Take into account that if you use words/tokens that people are familiar with, curiosity will get the best of them and the data could become compromised. If your program is called "eric", can you tell me what would be wrong with naming your data file eric.dat, with a line such as NumberOfTimesFileHasBeenDecrypted= in it?
I snoop around on my computer quite a bit to see what files are contained where. If a file has an interesting name, rest assured that I'm gonna try and open it. If the file looks like an ordinary file that could be found anyplace else, I'm probably not going to be interested. Ok, let's say that I've opened the file. If I see things in it such as Password=, it's a safe bet that I'm gonna try and do something with that. However, if it had stuff in it such as ColorDelta=, or DeviceDependency=, that probably is of no interest to me. You could take that one step further by renaming the entries in the file, either each time your program is ran, or on certain days of the week. Get the idea?
You could do the same thing with the registry. Just because the registry is more hierarchical than a file, don't think it's any more secure. I watch my registry on a regular basis, too! Programs "hide" stuff in the oddest places.
One other option that is available to you is to put the decryption count in the program itself. See UpdateResource() for this.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Most Sharewares use a combination of self-modifying code, the registry, and hidden files they stick in your system directory.
To know for sure what software is doing to your file system you need to be running a utility that monitors and reports on all disk activity.
You might think about using steganography throughout the encrypted file itself to store data about how many times that file has been attacked. Using this method will prevent the file from being copied and/or renamed and starting all over.
Maybe define a table at the beginning of each encrypted file that contains byte offsets for which data bits of which bytes contain not encrypted data but rather the number of attempts used to open that file:
struct steg_table
{
int nByteOffsets[NUM_STEG_BYTES];
int nStegBitNumbers[NUM_STEG_BYTES];
int nActualBitData[NUM_STEG_BYTES];
};
So maybe the nByteOffsets array might look like 68, 155, 366, 1204, 1344, 2265, 4976, 6512
and the nStegBitNumbers might be 1, 1, 2, 4, 6, 2, 3, 3
and the nActualBitData might be 0, 0, 1, 0, 1, 1, 0, 1
Meaning that the 1st bit of the 68th byte would actually act as the first bit of the count for how many times that file has been attacked.
The actual value for that bit would be stored as the first element of the nActualBitData array.
But this only works if the person doing the attacking is using your program!
There is no way to prevent a brute force attack on your data files themselves.
|
|
|
|
|
Like you mentioned it, with disk tracker utilities it's quite easy to find out what has changed since the last decryption.
And if I modify the encrypted file, they can overwrite the encrypted file with the original version, they copied before.
So I think I've no chance to prevent this. So maybe I can make a triple protection, I save the value into 1 file and 2 registry entry or vice versa...
So it's much better than without a protection.
If you're interested in the encryption program take a look at www.osborn-software.com!
Greetings from rainy cold Germany
Thx
Eric
|
|
|
|
|
You can put files in your own directory but disguise their intent. That way they appear necessary, and are not installed in some strange place. For example a sample file.
J.
----------------------------
|
|
|
|
|
I'm trying to create a dialog with the web browser control embedded inside. I would like to load an html web form and get both the static text from the html page and the data entered in the edit boxes to display on another webpage. Any ideas?
Thanks
|
|
|
|
|
Hi,
I have an app that uses MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT. The app basically extracts some temporary files from a .zip file to a cache directory. After each file is extracted, a delete on reboot key is added to the registry if the system is WinNT/2000/XP, otherwise WinInit.ini is used. If the program ends normally, the registry keys are deleted (or WinInit.ini is restored to its former state). The idea is simply that the cached files are cleaned up no matter how the program ends.
However, there seems to be some bug whereby the files aren't always deleted on boot up. Strangely, sometimes they are, sometimes they aren't. I can't find any logic behind it, despite having tested it over and over again. In every case my code seems to be working fine, as I check the registry before rebooting and the PendingFileRenameOperations key contains all of the info that should be there (all the paths to the files I want to delete with \\?\ before them or whatever). When I reboot, the PendingFileRenameOperations key is gone - as though it has been executed - but the files are not always deleted. Very strange. This is the basics of the code I am using to do this:
<br />
<br />
for (int currfile = 0; currfile < fileno; currfile++)<br />
{<br />
<br />
zip.ExtractFile(currfile,OutputPath_str);
<br />
<br />
<br />
if(MoveFileEx(szCurrFile,NULL,MOVEFILE_DELAY_UNTIL_REBOOT)==0)<br />
{<br />
}<br />
<br />
SetFileAttributes(szCurrFile,FILE_ATTRIBUTE_HIDDEN);<br />
<br />
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))<br />
{<br />
if(msg.message == WM_QUIT) {<br />
GRS_quit = 1;
break;<br />
}<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}<br />
Like I say, if I reboot during this loop or immediately after it, although the correct info is in the registry, the files are not always deleted in restarting.
If anyone has any idea as to why I might be getting this peculiar problem, I would be really grateful.
Many thanks,
KB
|
|
|
|
|
Does MoveFileEx() or SetFileAttributes() (is this required) ever fail? If so, what is the error from GetLastError() ?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi, thanks for the reply. This is the weird (and really annoying) thing - neither fail. I have checked their return values, and all is okay. And I have even checked the registry itself, and found that all the values are perfectly correct inside PendingFileRenameOperations, and everything seems fine. And yet still, sometimes when I reset the computer, nothing is deleted.
At first I thought that it must somehow be falling through to the code at the end of my program which removes the entries from the registry if the files have been deleted normally after the program has closed, but I tried commenting this code out and it made no difference.
This is really strange. Does anyone know of any reason why PendingFileRenameOperations in the registry might be ignored or just deleted at boot up without actually running?
Many thanks,
KB
|
|
|
|
|