|
I'm not too concerned about this - the average user won't be able to crack it, and pretty much any file packer with low-level protection can be cracked. I'm more interested in archiving the files to take up less space on the disk and running them without the need to extract them; that the average Joe won't be able to mess around with (or mess up) the files is an added bonus.
Does anybody know of a way to do this? (Other file packing suggestions are welcome too, though I quite like the Zip process as it saves me writing a packer.)
Many thanks,
KB
|
|
|
|
|
code a loader program, which extracts the zip file to memory, and then include a module in your program, which extracts and loads game data to memory!
Don't try it, just do it!
|
|
|
|
|
Thanks for the reply, but easier said than done!
I have been using the ZipArchive library from www.artpol-software.com so far, but I have no idea how to make the transition from extracting files to the hard-drive and then using ShellExecute() to launch the extracted game EXE (my current method) to extracting all the files to memory and running them from there (and bear in mind that the main game executable relies on a number of the other files that have to be extracted).
If anyone could provide some links to useful libraries or tutorials with code, or tell me the sorts of things I would need to do so that I can look them up, I would be really grateful.
Like I say, I am a novice who has only really used the basic WinAPI, so this is a very steep learning curve for me.
Many thanks!
KB
|
|
|
|
|
I'm new to C++, and I'm in the process of porting a program I made in Delphi to C++. The program creates a horizon chart, with stars and constellations and stuff. But I haven't got a clue how to create a bitmap in C++. Been looking at tutorials but none of them take u through the complete process. Can anyone help?
Thanx
The more knowledge we gain, the less we understand
|
|
|
|
|
what excactly do u wanna do with this chart??
display on a window, or save to the hard drive?
Don't try it, just do it!
|
|
|
|
|
Entire section of codeproject dedicated to this ....
http://www.codeproject.com/bitmap/
What you are asking is simple:
1) Create memory DC compartible with screen.
2) Create bitmap
3) Select bitmap into memory DC save original bitmap
4) Now all dc GDI functions will draw on your bitmap.
5) When done select original bitmap.
|
|
|
|
|
Our application allows the users to configure interface screens, using edit boxes, comboboxes and drawing elements.
If a combobox is designed on Win2K, and made say 10 characters wide, it will often only display 9 characters on WinXP because the default widths of scrollbars are not the same.
I'd rather not force people to use a particular scroll bar size, but short of changing the font size I can think of any other way to ensure the contents of my combos is fully visible.
We could design eveything on XP, which is fixes the immediate problem. But we'd still be stuck if anyone decided to customise their scrollbar width and make it wider.
Anyone have any suggestions?
Dan
|
|
|
|
|
You could find out the scrollbar width, and then compensate for it.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Hi all. I have an MFC dll that uses the CFileDialog class. I'm making a custom version using the default template, and capturing the messages and doing what I need to do. One thing I must do is force the window into list view only and keep it there, prevent the user from changing the view to thumbnail or list or icon view.
On NT my code works like a champ. For some odd reason though, it doesn't on Win2k. On Win2k the Open/Save dialog comes up, shows the list view ever so briefly, and then display a blank listbox with no items in it. When looking at the messages (using Spy++) I see the window gets the style change I'm sending (It actually gets 4 which is where I think my problem lies), and when it attempts the call the SetItemText, it fails.
Why is this happening? I think it's becuase there is another GWL_STYLE message being sent by the default message processing for the window, but its coming AFTER I perform my change, therefore overriding my change. I can change the view using the view button (But I'm going to hide this button) but that doesn't help me. Yes the dialog is set with the OFN_EXPLORER option. Here's the code snippet:
if(strcmp(_strlwr(szClassName), "syslistview32") == 0)
{
switch(x -> message)
{
//case WM_NCPAINT : // Needed if there are no items to display
case LAST_LISTVIEW_MSG : // Magic message sent after all items are inserted
// force report view (Gives the details)
ln=GetWindowLong(x->hwnd,GWL_STYLE);
ln&=~(LVS_ICON|LVS_LIST|LVS_SMALLICON);
ln|=LVS_REPORT;
SetWindowLong(x->hwnd,GWL_STYLE,ln);
//::SetWindowPos(x->hwnd,HWND_NOTOPMOST,
// 0,0,0,0,
// SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
ln=GetWindowLong(x->hwnd,GWL_STYLE);
ln&=~(LVS_ICON|LVS_LIST|LVS_SMALLICON);
ln|=LVS_REPORT;
SetWindowLong(x->hwnd,GWL_STYLE,ln);
// Hide the tool bar stuff we don't need.
TBBUTTONINFO tbinfo;
tbinfo.cbSize = sizeof(TBBUTTONINFO);
tbinfo.dwMask = TBIF_STATE;
tbinfo.fsState = TBSTATE_HIDDEN | TBSTATE_INDETERMINATE;
::SendMessage(hWndToolbar,TB_SETBUTTONINFO,(WPARAM)TB_BTN_LISTVIEW,(LPARAM)&tbinfo);
::SendMessage(hWndToolbar,TB_SETBUTTONINFO,(WPARAM)TB_BTN_DETAILVIEW,(LPARAM)&tbinfo);
// This id is the Windows 2k/Xp combo button for the detail option list
// With the current problem on Win2k, we should leave this button viewable until we can
// figure out why the list box doesn't update to the detail view properly.
// ::SendMessage(hWndToolbar,TB_SETBUTTONINFO,(WPARAM)40970,(LPARAM)&tbinfo);
...
Do the other stuff
..
Any ideas on how to ensure I am the last one to set the ListBox Style?
|
|
|
|
|
Hi!
How to get the music's detail information such as title, artist, album and genre etc from a CD format file?
Thanks!
|
|
|
|
|
...you may get them trough an InterNet service (try WinAmp) !
Kochise
In Cod we trust !
|
|
|
|
|
|
I have recently installed Microsoft SDK. The help folder of the main Microsoft SDK folder contains files with extensions .HXC, .HXI, .HXK, .HXQ, .HXS, .HXT etc. These are the help files as it is shown in the file type column of explorer. However, these files do not open. I am using WIN98 SE.
How to read/ view these files? Do I have to install some other update to read these?
Pani
|
|
|
|
|
|
Thank you Stephane.
I'll download h2viewer and try to view the files.
Pani;)
|
|
|
|
|
how can i begin to become a C++ programmer ?
thanks for reading
|
|
|
|
|
For your information.
I began to become a C++ programmer this way 5 years ago:
1) To get a PC.
2) To get some development tool for C++ (the compiler and linker).
If the OS is Windows, then the development tools may be Microsoft Visual C++ or Borland C++ Builder, etc.
If the OS is Linux, then it may usually be gcc or g++ or something.
3) To get a book which teaches the C++ programming language. (The language itself)
4) To get a book which teaches how to use the development tool(s) and basic knowledge on Windows / Linux programming.
Or to get the user manual for the tool(s).
5) Study hard. Practice and practice...
BuggyMax
|
|
|
|
|
what books did you learn ?
thanks alot
;P
|
|
|
|
|
The book I used to learn was Deitel & Deitel C++ How to Program. I have looked at many other programming books and this was the best by far. I later bought the C# and Java books in the same series.
dog_spawn
http://hatekill.yojutsu.com[^]
|
|
|
|
|
C++ from the Ground Up (2nd Edition)
C++ Primer (3rd Edition)
The C++ Programming Language (3rd Edition)
--------------------
Programming Windows, Fifth Edition
Programming Windows With MFC
... etc.
BuggyMax
|
|
|
|
|
Hi,
I need to disable the Most Recently Used command from the File menu in an MFC application as certain times. I have tried adding a Update Command handler like this, using m_bTestFile as my flag:-
void CMainFrame::OnUpdateFileMruFile1(CCmdUI* pCmdUI) <br />
{<br />
pCmdUI->Enable(m_bTestFile);<br />
}
It enables / disables OK but I have lost the list of files. I would like to do something like this....
void CMainFrame::OnUpdateFileMruFile1(CCmdUI* pCmdUI) <br />
{<br />
if(m_bTestFile)<br />
pCmdUI->Enable(FALSE);
else<br />
????
}
But what do I call to make it work as normal when m_bTestFile is FALSE, any ideas?
Thanks,
Ali
|
|
|
|
|
I don't know about disabling the MRU list but have some other suggestions. First make a copy of the list, then empty the real one so the File menu doesn't have any MRU items and finally copy the temp list back to the real one when want the user to see it again. A second approach is to leave it there but ignore any use of it. ie, When the user selects a MRU item, ignore it.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thanks for the suggestions. Ignoring the MRU items sounded like a good idea and fairly simple. I've successfully done this by adding a test in OnOpenDocument which aborts when it is not allowed to open files (with a helpfull message for the user telling them that what they want to do is daft!)
But the files get removed from the list because they fail to open, and the list is not grayed out. Its a good solution because the user can't destroy there own data, but its not as slick as I would like.
Copying the list and putting it back sounds ideal and I would like to try it if possible. But I have no idea how or where to do this, can you point me in the right direction?
Thanks for any help ,
Ali
|
|
|
|
|
Hi Alison,
Overide CWinApp::OnOpenRecentFile() and change it as follows:
BOOL CWinApp::OnOpenRecentFile(UINT nID)
{
ASSERT_VALID(this);
ASSERT(m_pRecentFileList != NULL);
ASSERT(nID >= ID_FILE_MRU_FILE1);
ASSERT(nID < ID_FILE_MRU_FILE1 + (UINT)m_pRecentFileList->GetSize());
int nIndex = nID - ID_FILE_MRU_FILE1;
ASSERT((*m_pRecentFileList)[nIndex].GetLength() != 0);
TRACE2("MRU: open file (%d) '%s'.\n", (nIndex) + 1,
(LPCTSTR)(*m_pRecentFileList)[nIndex]);
if ( bNotAllowedToOpenFiles )
InformUser();
else
if (OpenDocumentFile((*m_pRecentFileList)[nIndex]) == NULL)
m_pRecentFileList->Remove(nIndex);
return TRUE;
}
This also shows m_pRecentFileList is where the list is stored.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Sorry for the delay in responding, I've been away for the weekend. Thanks for the help, I'll have a look at your BOOL CWinApp::OnOpenRecentFile(UINT nID) function now.
Much appreciated ,
Ali
|
|
|
|