|
|
Thx.
|
|
|
|
|
Hi,
I want to check from my SDI application if a particular file is opened by the user, and if opened I want to close that file.
How do I do that?
Please advise
|
|
|
|
|
Basically, I believe there would be two types of approaches to this problem:
1. Hook the file system to send notifications when a file is accessed
2. Hook a system event to give you a notification each time a file is opened.
3. Use the standard file commands to prohibit access
The first method is by far the most troublesome and difficult, but will provide the most accurate, functioning results. You would need a low level access to the NTFS file system and be able to enumerate through currently open files. If the desired file is found in this enumeration, it is closed.
The second method relies on the Windows OS to give you a notification when a file system event occurs. The most effective way to accomplish this would be to use some IFS element. IFS (Installable File System) is part of the Windows DDK and allows you to build file system filter drivers, which can capture different events. FileMon is one example from this type of application.
The final option is the most easiest: when your application is started, you open the file in a non-exclusive mode, which means that all other attempts to access this file while your application has it open will fail. However, this means that only your application can access the file in question, and this approach will cause a system crash if used on critical system files. But for protecting application-specific files, this is the most effective one. For an example, see this article[^]
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I have been given a bit of source code which I am trying
to compile!
The code uses the functions
SetupDiGetClassDevs( ... )
SetupDiEnumDeviceInterfaces( ... )
which are in setupapi.lib
Unfortunately I get the error messages
error C2664: 'SetupDiGetClassDevsA' : cannot convert
parameter 1 from 'const struct _GUID *' to 'struct _GUID *'
looking at my .h files I see that param 1 takes a 'struct
_GUID' but in the msdn site it takes 'const struct _GUID'
I am led to believe my sdk is out of date!!
does anyone know where I can find the updates, I have
looked everywhere
I have already installed SP5
thank everyone and have a goog christmas
bob
|
|
|
|
|
|
Hi
I have the following warning when i link. (I can execute program perfectly though)
Programm1.exp : warning LNK4070: /OUT:PROGRAMM2.EXE directive in .EXP differs from output filename "C:\vss\MyProject\Debug\Programm1.exe"; ignoring directive
Any idea what this means?
Best regards
Jens
|
|
|
|
|
Per MSDN:
The filename specified in the NAME or LIBRARY statement when the .EXP file was created differs from the output filename that was either assumed by default or specified with the /OUT option.
A client program that uses the resulting DLL might encounter problems.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hm, could it be that you export some functions via a .def file?
Then check its first line - it should read as: LIBRARY PROGRAMM1.EXE
RK
|
|
|
|
|
Hell,everybody.
This is a problem from me. I install WinPap3.01, then install a packet analysis tool ethereal-0.8.16-capture. Of cource, I reboot the OS which is WinXp. My problem is that the analysis just report the UDP packet, can not report the TCP packet. It's very surprising! I think it is not the problemn of the Etheral, cause the other analysis tool can not work too.
Maybe it's the environment lead to the problem. My pc work on the 100M LAN (also, use ADSL). It is work correctly on the 10M LAN (Tool can report TCP packet). Whether I need set some parameter? How to do it?
Thank you in advanced!
This article comes from Code Project.
Thank you in advance!
|
|
|
|
|
Hi Friends,
I designed a graphical editor which supports Line,Rectangle, bitmap and Text control. Now how to implement z order as text control is window hence any object hidden behind it will be not visible.
Thanks
Z order with Windows and non-windows objects.
|
|
|
|
|
im assuming u build up a list of shapes to be drawn every time u update the screen ... then simply add a z-order variable to the shape class (u do have a shape class right?) and draw the objects from highest z-order to lowest (or visa versa) ... the painters algorithm in other words ... then all will be hunky dory
this isnt a good plan for game programming btw but u didnt mention games
"there is no spoon" biz stuff about me
|
|
|
|
|
But Window is object and Line Rectangles are not window. Hence if you pull window over these objects window will always occupy top position. Hence simply keeping variable will not work.
I am looking to design a application which will help to design a form run time. Any suggestion are welcomed. Is there is open source code on any side?
|
|
|
|
|
Hello Every body
I want to know that how can I find the type of
project from a vc++ project i.e If I have a sample project
how can I know its type such as dialog, sdi, mfc extension
dll, mfc regular dll, com dll, atl project, win32
static/dynamic dll etc.
Thanx in advance
Waiting for reply
|
|
|
|
|
Hi..every body..
Plz tell me any method or code to convert bmp file to tiff...
I'm using Libtiff library..if possible..code using this...
But if u have any other..then also..it is Good...
I'hope u anybody definatly help me...
OK! Good bye...
Sumit Kapoor
|
|
|
|
|
|
Is there any way to open and view files in PDF -format in an MFC application, just like any kind of bitmaps with IPicture -based codes in the Bitmaps / Palettes section? Thanks for any answers.
|
|
|
|
|
click ME[^]
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Thank you for the link, the PDF-in-the-box seemed pretty neat, but still there is a problem: i'd like to view PDFs without any logos or other extra stuff. Is there any way to bring PDFs into MFC -project? Thanks again.
|
|
|
|
|
As long as acrobat is installed your can just us a CHtmlView or "Microsoft Web Browser" control.
|
|
|
|
|
Thank you. Have not tested yet, but seem to be the answer.
|
|
|
|
|
Where to retrieve information about user font settings? SystemParameterInfo() is not it.
--
Sancte Míchael Archángele, defénde nos in proélio contra nequítiam et
insídias diáboli esto præsídium. Imperet illi Deus, súpplices deprecámur:
tuque, princeps milítiæ cæléstis, Sátanam aliósque spíritus malígnos, qui
ad perditiónem animárum pervagántur in mundo, divína virtúte,
In inférnum detrude. Amen.
|
|
|
|
|
From the archives, I don't have sure if this still works ...
NONCLIENTMETRICS systemMetrics;
systemMetrics.cbSize = sizeof(NONCLIENTMETRICS);
if(SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
(WPARAM)&systemMetrics,
&systemMetrics.cbSize,
NULL))
{
}
else
{
}
Cheers,Joao Vaz
Three primary LAN architectures for Network Engineers,
under the sky,
Seven OSI layers for the Open System Architects,
in their halls of stone,
Nine N-xDU operations* for mortal Developers,
doomed to die,
One protocol suite for the Dark Sysadmin,
in his dark server room,
In the land of mordor.net,
where the shadowed fibers lie
|
|
|
|
|
Unfortunately, I can't use that information as I'm not dealing with non client areas.
Thanks anyway!
--
Sancte Míchael Archángele, defénde nos in proélio contra nequítiam et
insídias diáboli esto præsídium. Imperet illi Deus, súpplices deprecámur:
tuque, princeps milítiæ cæléstis, Sátanam aliósque spíritus malígnos, qui
ad perditiónem animárum pervagántur in mundo, divína virtúte,
In inférnum detrude. Amen.
|
|
|
|
|
Just to recap:
From the archives:
Changing the font in the control panel sends a WM_SETTINGCHANGE
message to all programs with a parameter of SPI_SETNONCLIENTMETRICS.
The program is supposed to fetch the new non-client metrics, and adapt
accordingly.
So, you aren't interested in changing any of five fonts defined in the NONCLIENTMETRICS structure:
caption font, the small caption font, the menu font, the status bar
font, and the message box font ????
Cheers,Joao Vaz
Three primary LAN architectures for Network Engineers,
under the sky,
Seven OSI layers for the Open System Architects,
in their halls of stone,
Nine N-xDU operations* for mortal Developers,
doomed to die,
One protocol suite for the Dark Sysadmin,
in his dark server room,
In the land of mordor.net,
where the shadowed fibers lie
|
|
|
|