Detecting that file is downloaded, moved and copied - c++

Is there an idea to handle that file downloaded by any browser or moved or copied from another location (not downloading or moving or coping)?
Safari and Chrome add .(.*)download extension, so download finishing easily handled.
Moving or coping are rapid processes so they can be handled by file size difference after some delay. But it also can be unreliable in some cases like firefox download process.
Also I want cross-platform solution. I use Qt framework.

I am not sure exactly what your question is, but perhaps QFileSystemWatcher is what you are looking for.
From the documentation:
The QFileSystemWatcher class provides an interface for monitoring
files and directories for modifications

Related

Using DISM Api to Capture Image Programatically within Windows PE Environment

I've been going through the windows documentation for the Dism API with the goal of writing an exe in C++ (or whatever language can accomplish this) that can create a WIM image while running in Windows PE. I found a .NET Wrapper for the Dism API that seems like it might be useful for this purpose, but I'm unsure if a .NET app will successfully run in Windows PE. Overall, my problem is that I don't see a function that can create--and doesn't simply modify--a wim file.
If I didn't care about encapsulating this in an .exe file, the Dism documentation does show how to initially create a wim--which makes me curious why a similar function wouldn't exist within the api. Please advise if the simplest solution is to have my code call a function such as system() within the code.
To summarize, I'm looking for a way to create a wim file programmatically (called from executing an exe file) from within Windows PE.
As always, thank you for the help and advice.
I work on a project that works with DISM in WinPE quite a bit. We configure WinPE with all the .net packages as described here. Then WinPE can be configured to start an application.
I use c#, but you can do managed apps in c++ as I'm sure you know. I find putting c# code into WinPE substantially easier, but that's more a function of my experience, I suppose.
The main way we use to interact with DISM is run a command using System.Diagnostics.Process. The process runs in a separate thread, but the API is simple, and you can wait on (and/or timeout) your process for synchronization purposes. This just uses the DISM command line interface, although you can also use powershell cmdlets if you've added that package to your WinPE image. It may seem like a hacky "interface" from your app to DISM, but it works reliably, and you can keep the process window from showing up on the screen. This makes for a decent asynchronous platform for running bunches of windows imaging utilities, such as DISKPART, DISM and BCDEDIT.
The principal way you'd capture a new image is with DISM /Capture-Image. Sounds like you've already discovered this fact. Lots of options that are somewhat beyond the scope of this q/a, but I hope this gets you on a useful path.
Even though this post is a bit older, here is a possibly still relevant resource for you. Perhaps this one will help.
I've written a small GUI-based tool, project-named WIM-Backup, that uses the Windows Imaging Format (WIM) to create full backups of computer systems (operating system images) within WinPE and then restore them.
The application is hosted on GitHub, is open source, and is offered under the Apache 2.0 license.
In addition, the repository includes an illustrated step-by-step guide to help get it up and running.
Brief summary:
WIM-Backup always requires an external bootable media such as a USB flash drive.
From this drive WinPE is booted to perform a backup or restore to or from an external medium (e.g. a USB hard drive).
On the bootable USB flash drive the WinPE must be set up before (is documented illustrated in the readme).
After completion of the respective operation, a status message is displayed whether the operation was successful or failed.
After restoring a backup, you can boot normally from the destination drive.
Both the backup and restore process are relatively simple (not "rocket science").
To set up the solution, you need about 30 minutes time in the best case due to the necessary downloads (e .g. ADK)
Last but not least: it has a permissive license (non-proprietary) and is open source.
The project can be found here: WIM-Backup

Adobe Premiere Pro Extension using ".exe" file

Currently I'm developing an extension for Premiere Pro that should use .exe file to make things happen.
The main algorithm is written in python and works with actual video files: reads them frame by frame, processes the information in pixel level... I'm thinking of making an executable from it and call it from extendscript to make things happen...
Is this the right way to go ? Or should I consider other technics like writing a plugin using the PPro SDK and call it from extendscript ? Is it possibe to access the actual video-files, read them, get pixel values with SDK ?
Thanks.
I'm not sure how good the Premiere SDK is, but the drawback I can see to use the SDK you would have to port everything to C++. If that's less work than creating the Extendscript bridge it would be the way to go.
The PPro Extendscript documentation is notoriously non-existent.

Qt Single Application file opened

I am making an Qt Application.
And I have 2 problems that kind hard for me to figure out :
I create my own file type for my application document, so let say "something.ap". I want my OSes (Windows and Mac, maybe linux), when double click those file on file explorer, it will open using my application. How to implement this on Qt in easy way? On Windows I saw we need to edit the registry, but if there is a good way that will be best thing. And I don't have idea on Mac and Linux.
Related to number one. When I already open my "something.ap", and then I double click the same file ("something.ap"), I won't my application open again on new instance. So the behavior I want is to check if already file opened, it will raise the window of the application. I saw there is QtSingleApplication, but when I check the repository on gitorous can not be access.
Thank you for any help, and sorry if you can't understand my English.
You need to register mime type. check this
Singleton application is available here. It's not maintained any more :P. You can download source as zip or clone the git repository.

Drag-and-drop onto the desktop or into a specific folder, without temporary storage.

I've written a little file-transfer application written in C++ using Qt 4.x. It logs into a server, shows the user a list of files available on the server, and lets the user upload or download files.
This all works fine; you can even drag a file in from the desktop (or from an open folder), and when you drop the file icon into the server-files-list-view, the dropped file gets uploaded to the server.
Now I have a request for the opposite action as well. My users would like to be able to drag a file out of the server-files-list-view and onto the desktop, or into an open folder window, and have that file get downloaded into that location.
That seems like a reasonable request, but I don't know how to implement it. Is there a way for a Qt application to find out the directory corresponding to where "drop event" occurred, when the icon was dropped onto the desktop or into an open folder window? Ideally this would be a Qt-based platform-neutral mechanism, but if that doesn't exist, then platform-specific mechanisms for MacOS/X and Windows (XP or higher) would suffice.
Even though I have never done exactly what you intend, I reckon this is doable with Qt.
You first have to deal with the drag event. This depends on the view you are using to see the files heirarchy in your server. Anyway here is a link to help you enable drag files from your view: http://www.trinitydesktop.org/docs/qt4/model-view-dnd.html In short it's just a couple a virtual functions to reimplement. The doc is here to help.
You may also see this link about how Drag/Drop events are handled in Qt: http://www.trinitydesktop.org/docs/qt4/dnd.html
I was about to answer about the drop event, when I noticed that the same question was asked word for word 3 years ago...
Qt 4.x: how to implement drag-and-drop onto the desktop or into a folder?

How to access the picture file on iPod/iPhone?

When I connect the iPod (or iPhone) to the Windows PC,
it look like an USB drive, but I can't open a file on it because I can't know the correct file path.
I was also unable to drop the file to my application because the drag source does not have CF_HDROP.
Some applications can open a file on iPod, but it was a copy on the local temp folder.
screenshot http://img862.imageshack.us/img862/5396/ipodx.png
My question is ..
How can I directly (programmatically) open and read the picture file on iPod?
If I double click on it (or right click and select Preview menu),
it launches Windows Photo Viewer -- it is not my default picture viewer.
Can I change the file (.PNG) association to other application?
What's the viewer application's requirement to be a default viewer for files on ipod?
Applications that do that use Picture Transfer Protocol (PTP). On Windows Microsoft implements many interfaces as part of Windows Image Acquisition (WIA). Read more here: http://msdn.microsoft.com/en-us/library/ms630344(v=VS.85).aspx
http://support.microsoft.com/kb/307859 or manually edit registry at HKEY_CLASSES_ROOT\.png
Try the iPhoneBrowser program. It should give you a fair idea of the path.
From everything I've read I don't think Apple gives you access to the file system on the iPhone / iTouch / iPad; they want you to use iTunes to transfer files back and forth. I believe the Android and Windows Phone environments have similar restrictions. (If you "jailbreak" or "root" your device that's obviously a different story, which is why many such utilities explicitly state they only work on rooted devices.)
In part, this is a security precaution: if it were possible to directly access the file system on the mobile device it would be that much easier for someone to plant malware on your phone or PDA.
For this reason, updates to the various mobile OSes frequently include changes to (1) make jailbreaking more difficult and/or (2) close the loopholes that allow software like the iPhoneBrowser to work.
Some of the portable music players that use (Windows) Media Player have similar limitations. For example, I had a Sansa m100 (I think) where I could just drag files to the device and the playlist would automatically get updated; on at least some of the newer models (eg the c200) you have to use Media Player to download content. Which to me is annoying since there doesn't seem to be a way to use Media Player to delete content from the device.
There probably are APIs to do this sort of thing, but I would guess they're somewhat specific to the platform you're using -- ie I don't think you're going to be able to just use CreateFile() or something like that.