|
Hi David,
You may write a value in the registry under the key *ROOT*\Software\Microsoft\Windows\Current Version\Run, where *ROOT* can be HKEY_LOCAL_MACHINE (all users, if you have enough rights) or HKEY_CURRENT_USER (only current user).
I don't know or can't remember if that can be done with an API call, maybe one of the Setup API.
Paolo.
|
|
|
|
|
I am now adding an entry to the ..\Run key with the utility path, and it is running fine each time I log in.
Is it possible though to do it another way. So long as the product is installed, this uitility must be present when the user is logged in (it's a kind of auto-change detect / restore utility very simialr to SourceSafe(r)). If it isn't loaded then the user will be able to get around password protected files and folders using this system.
I doubt many people will edit the registy to get rid of it, but some people might, and I need to gt around this.
I have tried creating the entry in the rgistry as read only, but it doesn't work.
Thanks in advance for any help, and excuse my bad spelling,
David Wulff
|
|
|
|
|
Hi David,
Don't worry for the spelling, many people here hasn't got English as mother tongue. I'm Italian...
The problem is: every user can terminate the utility at any time, with TaskManager on NT/2000 or by pressing CTRL+ALT+DEL on Win9x.
You can't safely protect the files this way, but really solving this problem involves the creation of a Service (only on WinNT/2K) or maybe a Device Driver.
You may have a program act as a service on Win9x by calling RegisterServiceProcess(), but I can't tell you more, this goes far beyond my knowledge...
I don't know if there's a simpler way...
Maybe you could consider writing a shell extension, which is loaded by Explorer and, running in a DLL, can't be terminated without terminating Explorer. Restarting Explorer after such an operation would reload your DLL too.
Manually removing a Shell Extension from registry is not a simple operation, and most users and even programmers are not able to do it.
I can't tell you which type of extension to implement and exactly when your DLL gets loaded by Explorer, but you may start reading the articles you find on CodeProject about Shell Extensions (there are some tutorials too).
You also have to pay attention to the fact that your code would run in a DLL, that is in the process space of Explorer, so an unexpected condition could crash Explorer too.
I don't know if this is the right approach to the problem...
You should ask someone else, or someone else should reply to you
Paolo.
|
|
|
|
|
----
Don't worry for the spelling, many people here hasn't got English as mother tongue. I'm Italian...
----
That's just it though, i'm British!
Thanks for the reply. I'll have a look using the approaches you mentioned, they cerainly sound doable.
|
|
|
|
|
Our entire development team here has been suffering from a strange VC IDE problem. I was wondering if any of you have come across this.
Our project is pretty big. 10 dsp files around 4000 files and 3.5 million lines of code.
Often during development, the IDE stops responding, the CPU gets pegged at 100 (or near there) and no redraws happen in the IDE. On my 650MHz machine (with 256MB of RAM) this state lasts 10-15 minutes and then all resumes. It got better when I added tons of header files to the MSVCINCL.DAT files is used to exclude files from the file dependencies. I talked to MS tech support and they said that it seems to be a dependency update pause (!). They said the file limit is around 9600 files so that isn't it.
One of my co-workers got a GHz machine and the pause is barely perceptable.
I was wondering if there are any work-arounds any of you know about?
TIA
Woolie
|
|
|
|
|
Often the workspace .ncb file will become corrupt, and this can cause a lag. Also, best of luck to you if you are using VSS...
You can safely delete the workspace .ncb file. It will get regenerated. If you find this fixes your problem, you may wish to write or find a utility to delete the file automatically. Several exist, though I will shamelessly plug one I wrote called NukeNCB.
Best of luck,
Nick Hodapp
|
|
|
|
|
Like Nick, I've found that deleting *.ncb files seems to cure almost every problem I have with the IDE.
I don't use any VCS system yet but I make zip backups of my source directories at least once a day. I've got the batch file that does the zipping setup to delete any .ncb files, among others, before it makes the archive.
Be aware that the *.ncb file is locked while the project is loaded in the IDE. I seem to recall that the IDE occasionally fails to release the file lock when you close a project from the File menu. I now just exit the IDE to make sure that everything is closed properly.
|
|
|
|
|
Howdy all.
First, I want to apologize for what I am about to do. Yes, I am going to ask a how to related question.
See, I am messing with CListCtrl objects and find that I want to insert an image in a subitem. I can do this, it isn't hard. My problem is that once the subitem image is added, the main item also seems to be forced to have an image. I was wondering if anyone else had this happen to them.
Thank you.
|
|
|
|
|
I messed around with it for a few minutes, and it looks like just doing a ListView_SetImageList() call forces every column 0 item to have an icon.
I.e., if you do:
LVITEM i = {0};
i.mask = LVIF_TEXT;
i.pszText = _T("blah");
ListView_InsertItem ( hwndList, &i );
The "blah" item gets image #0 in the image list, even though LVIF_IMAGE wasn't in the mask.
|
|
|
|
|
Hi.
Please, i want to add two different color lines to a EditBox, dunno if it's possible, i want by example, one red and one blue.
Can anyone show me the code on how to do this?
Thanks in advance.
Regards, James.
|
|
|
|
|
I want to download a file using WinInet API/MFC. I can't use FTP. File might be any type such as bmp, dwg, or doc. Any ideas???
Thanks in advance.
|
|
|
|
|
|
I ran your exe. I got error download failed: Error 80004004 during download. I tried to download asp and dwg files. I tried to download file http://www.mindcracker.com/my/mh.dwg
Any ideas?
Thanks for your help.
Mahesh
|
|
|
|
|
I'm having one of those "stupid" problems.
I have a basic ATL ActiveX control with a child TreeView. In the control's message map, I handle WM_NOTIFY for TVN_KEYDOWN, with the intent of catching VK_F5 and VK_DELETE. However, my handler is never called for these key presses.
I do process PreTranslateMessage(), and allow these keystrokes to reach the control, just as I do VK_LEFT/RIGHT/UP/DOWN, which do make it into my TVN_KEYDOWN handler.
Spy shows that the control isn't sourcing a WM_NOTIFY for those keystrokes. ??? Why the heck not?? Is my container messing with me? The listview control is receiving WM_KEYDOWN/UP messages for all keys.
Regards,
Nick Hodapp
|
|
|
|
|
I haven't fixed this problem yet, but I think I understand the issue. I think that my container -- including the Test Container, has an accelerator table defined to map keystrokes to commands. The tree control, upon receiving WM_KEYDOWN is calling TranslateMesssage(), and upon finding that the keystroke is mapped, discontinues processing.
Ugh. Fine. I will unleash my subclassing power upon the meek and prevail.
Nick
|
|
|
|
|
I had a big problem with Enter Key in tree control.
I found a bug report on MSDN.
You may try article "Q130691"
or http://support.microsoft.com/support/kb/articles/Q167/9/60.asp
hope it can help.
larry
|
|
|
|
|
Hi every body,
During long processing, i display a modeless dialog like this :
CModelessDlg * DlgAttente; // CModelessDlg is my class
DlgAttente = new CModelessDlg;
DlgAttente->Create(IDD_DIALOG_ATTENTE,this);
DlgAttente->ShowWindow(SW_SHOW);
DlgAttente->m_Message="Please wait, processing is being......";
DlgAttente->UpdateData(FALSE);
m_message is a variable bind to CStatic control ( label ). It shows my messages.
This code work well, but if i display another window, for example, windows explorer, Bloc Notes, then close it, my modeless dialog don't refresh. The message show on it by my CStatic disappear without trace.
Can anybody help me ??
Thanks in advance
|
|
|
|
|
You need to process waiting Windows messages during your "long processing". If your long processing is a loop, simply add code like this inside the loop:
MSG msg;
while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
::DispatchMessage(&msg);
This will periodically dispatch waiting messages -- including the WM_PAINT messages that are waiting to be processed for your dialog.
Alternatively, do your "long processing" on a separate thread.
Regards,
Nick Hodapp
|
|
|
|
|
I know that somehow you can draw a unicode character from a font that contains the character using the glyph index. MSDN contains a brief article about a tehcnique for mapping the unicode number to a glyph index so it can be rednered using exttextout - however I can not get this technique to work. Can someone please lend a hand and provide a simple example of how to draw a foriegn character on a dc in windows 95/98. Ie can do this, there must be a way
|
|
|
|
|
You can use ExtTextOut and glyph index to display any glyph in a font;
Or you can use TextOutW or ExtTextOutW to display UNICODE string without using glyph index.
http://www.amazon.com/exec/obidos/ASIN/0130869856
|
|
|
|
|
How can I get serial number of hard drive in Win32?
|
|
|
|
|
G'day Vaslieyev,
One way that I know of is with the ::GetVolumeInformation() function. There may be other ways though.
Hope this helps.
Steve
|
|
|
|
|
Check out the GetVolumeInformation() win32 api function...
CString sRootPath = "C:\\";
char sVolumeNameBuffer[MAX_PATH];
char sFileSysNameBuffer[256];
DWORD nFileSystemFlags = NULL;
DWORD nVolSerialNumber = NULL;
DWORD nMaxFNameLen = NULL;
::SetErrorMode(SEM_FAILCRITICALERRORS);
::GetVolumeInformation((LPCTSTR)sRootPath,
sVolumeNameBuffer,
sizeof(sVolumeNameBuffer),
&nVolSerialNumber,
&nMaxFNameLen,
&nFileSystemFlags,
sFileSysNameBuffer,
sizeof(sFileSysNameBuffer));
|
|
|
|
|
I'm having a hard time forcing my ATL control to size itself.
I tried SetWindowPos and MoveWindow. They each return 1, meaning "OK", but the control never changes size.
Is there something else I need to do to make the resize happen?
(i'm testing it on an MFC dialog app, but i want to be able to use this anywhere).
-c
|
|
|
|
|
When Creating you ATL Control make sure that you expose the AutoSize Stock Property. Then in the InitialUpdate or InitDialog Function of your app set the AutoSize Property = false; I suppose that alternately you can find some mechanism to set it inside the control to always be false, but I just did a quick run through and didn't dig to deeply.
|
|
|
|