|
Hi,
I appreciate your prompt response, I already tried this one too.
This will return read only if a file "attribute" is flagged "Read Only".
CFileFind also work based on "Read Only" attribute set on the file, if the file is "not flagged" "Read Only",
it does not look at the Windows-NT ACL security settings.
In my situation, the file is not marked read only (i.e is the read only attribute is not set)...
but I used file->properties->security and Removed the existing settings and added EveryOne -> Read. This makes the file read only even though the the attribute is not set to Read Only.
What happens here is file itself is not read only, but it is made read only for certain users using NT security settings.
If I add one more setting for individual user and give "FULL Control" that user can write to the file.
But the Standard C functions access() and
CFileFind::IsReadOnly() looks at the attribute setting not at the security level settings. So what happens is, these functions return the file is writeable, even though we can not write to it.
I have no clue how to get actual file permissions based on the Security settings
Any info regarding this will be highly appreciated.
Thanks
Kumar
|
|
|
|
|
Hi
I have a problem with SHFileOPeration. I want to copy files from Hard Disk to Floppy Disk. When no disk is inserted in my floppy disk, the message.... is Try or Cancel. When i clicked Cancel, the return value of SHFileOPeration is 0 like if the function works correctly.
How can i know if 0 means thats the copy is good or the action was cancelled ?
Thanks
Eric
|
|
|
|
|
Hello,
I start at least 4 threads in my program (besides the main program thread).
They all have ::WaitForSingleObject(...); in them, one is for file notification update, one is for other stuff, anyway, my question is, how much does this IMPACT on program speed & memory consumption in general (depending on CPU and memory)? (I'm working on a small file manager app coded in MFC).
If anyone got any comments I'm happy to here them. How many threads could one run with ::WaitForSingleObject(...); in them before it would get noticable (depending on CPU and memory)?... How many threads does a normal window program run, and a Windows 95/98/XP session in general?
So all you thread experts, gimme comments!
Cheers,
Henrik
|
|
|
|
|
A thread that is blocked in a WaitFor...() call uses no CPU time. If all your threads are running, the CPU will be doing more context-switching, which is an expensive operation (on the order of 200 CPU cycles, IIRC).
Each thread uses memory, of course, for its stack and whatever state info the OS keeps on it. But if your threads are blocking for the majority of the time, I don't think you'd run into problems.
--Mike--
http://home.inreach.com/mdunn/
The Signature, back by popular demand: Buffy. Pajamas.
|
|
|
|
|
I saw many examples how to write context menu shell extension for IE, but is it possible to do the same fo IIS 5.0 ? The example references or same articles would be very prishieted..
Thanks a lot
|
|
|
|
|
I need to inicializate a vble with the name and the path of a file that is in the directory where I have the program .exe and I have other vbles that depend on where the user places the files. How can I do it so that the program dinamicly accepts it without the user having to modify it?Thanks
|
|
|
|
|
If i understand it correct you are trying to get the directory where your .exe is working .
You can get it like this
CString strFullPath;
LPTSTR pBuffer = strFullPath.GetBuffer (MAX_PATH);
GetModuleFileName (NULL,pBuffer,MAX_PATH);
strFullPath.ReleaseBuffer ();
I hope this helps.
Orcun
|
|
|
|
|
Hi, my problem is, thet i want to write a logon/password dialog for all windows versions.
I have written some code which disables alt+esc and alt+f4 and alt+tab.
I used a low level Keyboard hook to do this.
But I am not able to disable Ctrl+Alt+Del.
I even thought about implementing some Onscreen Keyboard (code from codeproject). But i think this is not so good for a password dialog.
Any suggestions are welcome.
thanks
Bernd
|
|
|
|
|
There is no reason your hook shouldn't be able to catch CTRL-ALT-DELETE.
|
|
|
|
|
Yes, but why not??
I've read the MSDN up to now, but the only thing i get is this:
It#s not possible to disable Strg+Alt+Del under Win2k. Only way to do this is to write a replacemant of the Windows Gina DLL.
But I don't want to do this. ( To much effort)
I MUST be possible with an other method, because i have seen an application disabling it (i don't remember the app. )
Please let me know if you can help me.
thanks
Bernd
|
|
|
|
|
<quote>Yes, but why not???
... Because Ctrl+Alt+Del is the NT SAS (Secure Attention Sequence) which, due to the C2 security requirements, can only be intercepted by a trusted GINA .DLL -- so, as you point out, the only way to disable it would be to replace the default GINA.DLL with your own and implement WlxLoggedOnSAS() to return WLX_SAS_ACTION_NONE whenever it receives a WLX_SAS_TYPE_CTRL_ALT_DEL notification
|
|
|
|
|
Hi, my problem is, thet i want to write a logon/password dialog for all windows versions.
I have written some code which disables alt+esc and alt+f4 and alt+tab.
I used a low level Keyboard hook to do this.
But I am not able to disable Ctrl+Alt+Del.
I even thought about implementing some Onscreen Keyboard (code from codeproject). But i think this is not so good for a password dialog.
Any suggestions are welcome.
thanks
Bernd
|
|
|
|
|
In NT/2000 use gina dll!
in 95/98 use SystemParametersInfo
hi
|
|
|
|
|
Does anyone know how to launch the "Properties" common dialog box from an application?
I mean the dialog that's produced from the context menu in Explorer (right click -> Properties)
What information is needed in order for the dialog to display the properties of a file, does it just need the path and filename??
Thanks in advance!
Liam O'Hagan
Senior Test Engineer
GLI Australia
www.gli.com.au
|
|
|
|
|
|
Grrrr it doesn't seem to work!
I'm using the following code...
ShellExecute(NULL, "properties", Filename, NULL, NULL, 0);
where Filename is a CString containing the absolute filename i.e. c:\temp\test.txt
I am using it in a handler for double clicking on a listbox containing a bunch of files, similar to the listbox on the right of explorer..
Any ideas anyone? I'm stumped...
Senior Test Engineer
GLI Australia
www.gli.com.au
|
|
|
|
|
Hello,
I got a small linking problem, I get this error:
TabCtrlEx.obj : error LNK2001: unresolved external symbol __imp__PathCompactPathA@12
Debug/FileOpus2.exe : fatal error LNK1120: 1 unresolved externals
I try to use ::PathCompactPath(...);
I do include the "shlwapi.h" file in my project, but still doesn't want to work.
Any tips?
Cheers,
Henrik
|
|
|
|
|
You need to link with shlwapi.lib too, so the linker knows which DLL contains the PathCompactPath() function. On the Link tab of your project settings, add shlwapi.lib.
--Mike--
http://home.inreach.com/mdunn/
The Signature, back by popular demand: Buffy. Pajamas.
|
|
|
|
|
Hello, the codegurus around the world.;)
The other way is to add the followings.
#include shlwapi.h
#pragma comment( lib, "shlwapi" )
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I want to write a actviex control using Directx8 to draw something on it. so I use ATL to builld a full control project, and then select the window only option. Though I get a valid HWND(m_hWnd), I couldn't use this to initialize the D3D device, I always get a NULL LPDIRECT3DDEVICE8
------------------------
yupl@163.net
yupl@eyou.com
PHD YLLY
|
|
|
|
|
Hey ppl
I heard that there was a macro I could use in VC++ that would allow me to use dialog's etc... from a inside a DLL (ie. use in a plugin)
Regards
|
|
|
|
|
I'm using a CAxWindow to host a web browser in a shell namespace. To handle keys like backspace, delete, tab and not pass them on to windows explorer I use the following code to call the IOleInplaceActiveObject->TranslateAccelerators and then return S_OK so explorer does not process the keys as well. This works fine in Windows 2000 but on NT4 it returns a HRESULT
value of 1 (Incorrect Function). I can even call other IOleInplaceActiveObject methods without a problem but not TranslateAccelerators! Microsoft documentation just states that one should use basically the same code as below.
What does 'incorrect function' usually mean? Is this method not implemented?
ContainerWindow is declared as a CAxWindow
STDMETHODIMP CShellView::TranslateAccelerator(LPMSG pMsg)
{
if ((pMsg->message >= WM_KEYFIRST) && (pMsg->message <= WM_KEYLAST))
{
// Activate the control in the container
CComQIPtr<ioleobject, &iid_ioleobject=""> spOleObject;
ContainerWindow.QueryControl(IID_IOleObject, (LPVOID*)&spOleObject);
if (spOleObject)
{
RECT rect;
GetClientRect(hwndContainer, &rect);
spOleObject->DoVerb(OLEIVERB_UIACTIVATE, NULL, (IOleClientSite*)this, 0, hwndContainer, &rect);
}
}
if ( ((pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP) &&
(pMsg->wParam == VK_TAB || pMsg->wParam == VK_DELETE || pMsg->wParam == VK_BACK)))
{
CComQIPtr<ioleinplaceactiveobject, &iid_ioleinplaceactiveobject=""> spInPlaceActiveObject;
ContainerWindow.QueryControl(IID_IOleInPlaceActiveObject, (LPVOID*)&spInPlaceActiveObject);
if (spInPlaceActiveObject)
{
HRESULT hr;
//*******************************************************
// This returns "Incorrect Function" on NT
hr = spInPlaceActiveObject->TranslateAccelerator(pMsg);
return hr;
}
}
return S_FALSE;
}
|
|
|
|
|
Hello,
Anyone know how I can set the read-only attribute on a directory?
I tried ::SetFileAttribute(...); but it doesnt seem to work.
Also, if someone know how I can safedel files (delete them to the trashcan) I would be happy if you told me ...
Cheers,
Henrik
|
|
|
|
|
<<< In the name of GOD >>>
Hi.
If anyone have any notice about using of ActiveX, please write for me.
Thanks.
Hadi Rezaie
|
|
|
|
|
Hi: I have written the follow instruction in VC++ to execute a program in Unix machine:
system("rsh dirIP -l root -n sh path\name parameters -l")
but it open a cmd windows. What can I do to not to show this windows? Thanks
|
|
|
|