Hi I've a requirement to hook into the PrintDlg/StartDoc/EndDoc API's using a global hook to obtain information when the end user does a print from any application that has a File/Print interface. Any ideas as to what might be the best way to do this ? I'm considering using APIHijack - A Library for easy DLL function hooking by Wade Brainerd (http://www.codeproject.com/dll/apihijack.asp[^]) Any ideas/suggestion would be welcome.
P Gibson
Posts
-
Advice on Global Hook -
FindNextPrinterChangeNotification - Invalid HandleYou seem to have missed the point ... I know openprinter returns a handle which is then used by FindFirstPrinterChangeNotification which itself returns a handle which is then used by the FindNextPrinterChangeNotification api. I've written out several items including the handle values, which are correct and don't change between the FindFirst and FindNext calls, but the FindNext call always errors with an invalid handle - but why with network printers ?
-
FindNextPrinterChangeNotification - Invalid HandlePrintername for network printer is in the correct format, my call to OpenPrinter is successful. Its the call to FindNextPrinterChangeNotification that is actually failing with an invalid handle.
-
FindNextPrinterChangeNotification - Invalid HandleI've written a VC++ 6.0 app (based on Microsoft's Printmon example) that uses printer notification api's. These work fine for local printers but whenever I try a network printer (\\server\printer name) my application fails with an Invalid Handle from the FindNextPrinterChangeNotification api call. The Printmon example also does this. My client is XP with SP2 and the servers holding the queues are Windows 2000 and Windows 2003, anyone any ideas ?
-
StartDoc not being called by wordSolved it ... word (winword.exe) calls ExtEscape - why I do not know!
-
Find files that are being usedhere is the actual link http://www.codeproject.com/file/directorychangewatcher.asp[^]
-
code required to obtain printer statusI've emailed the code snippet
-
Find files that are being usedHow about using the CDirectoryChangeWatcher class that is on codeproject ?
-
code required to obtain printer statusHi David, thanks for the quick reply, my application always retruns in the status dword 0 ... even when the printer is offline, or the printer has the top cover open, or a tray open it always returns 0.
-
code required to obtain printer statusHi writing a VC++ 6.0 application and I need to obtain the status of a printer and PRINTER_INFO_2 structure does not work, so I'm looking for some example code that uses SNMP MIB I know it is possible to query the printer to obtain this info but how in C++ using SNMP ? Any info/inks etc would be appreciated
-
Set Folder AttributesThanks very much that will do nicely.
-
Set Folder AttributesBy default on our XP cleints the indexing service for folders is turned off, I want to set a folder and its files to have the indexing turned on, SetFileAttributes would seem to be the way of doing this but there does not seem to be a constant to do this, so what is the reverse of FILE_ATTRIBUTE_NOT_CONTENT_INDEXED ? Or anybody know how to do it in Window Script ? I've had a good search and cannot find anything, any help, as ever, will be much appreciated.
-
Roaming profileHi I need to determine, if possible using VC++, the size and date information relating to the current logged in user's profile. I can get who is logged in, their Domain and SID value, but struggling to find how to find out details as to if the user's profile is roaming, local etc and then the size/quota, date etc information. Any help would be greatly appreciated, thanks in advance. Phil
-
File CompareI'm writing a C++ application that needs to compare two text files for differences (addition/changes/deletion of an line), so some source code for comparing is required that is fast (and accurate) as some files maybe more than 5MB in size, but usually will be several hundred KB. The output could be either to another text file or a List Control. Any recommendations as to what to use, or any examples available would be most appreciated.
-
Explorer foldersI am developing an application which is looking at the process running on the PC. For Explorer.exe I can get the window title, but does anyone know where in the registry, if at all, this title matches up with a folder name. For example Title=RandP CommandLine=C:\WINDOWS\Explorer.EXE so how do I get at the text in the Address control of Explorer ? does this info get saved/stored in the registry ? Any help would be much appreciated. Phil Gibson
-
Pause JournalrecordI'm developing an in house application, and I want the user to be able to pause a journal file when it is being played back, by the using pressing PAUSE and resuming playing by pressing PAUSE again. I have set hooks for journalrecord and journalplayback, and they both work ok, it would seem that once started to play a journal file cannot be paused, but can be stopped using ctrl+alt+del. I'm using VC++ 6.0. Any help would be much appreciated. Phil
-
Get commandline arguments from processThis is just what I was looking for, many thanks it is much appreciated.
-
Get commandline arguments from processWhilst I can get all the processes running on my workstation and hence a handle to the process, and the .EXE name. How can I get the commandline arguments for that process ? I'm trying to write an app so that I can identify the processes better, as we have several wscript.exe scripts run at login time, but some need to be killed by the user after login, any help would be gratefully received.