Messages - gtoal [ switch to compact view ]

Pages: prev1 2 3 4 [5]
21
Here's a quick template for how to write a C utility that you can invoke from a right-click, and below that are the contents of a .reg file that would point to the binary.  I've called it "bury" in this example, since it would bury a file one level deeper in the file tree...  It does show a command window for a few seconds, then it closes. (code extracted from a utility I wrote to gpg-encrypt a file on a right click.  That one unencrypts it on a double-click)

-------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

int main(int argc, char **argv) {
  char command[4096];
  char *s = command;
  int rc = 0;

  if (argc != 2) {
    fprintf(stdout, "syntax: bury filename\n"); exit(1);
  }

  /* strip file extension, create subdir of that name, rename file to be inside subdir */
  /* take care when file has no extension or the rename fails or it is a link or a drive root */

  //rc = system(command);
  //if (rc != 0) exit(rc);

  exit(rc); return(rc);
}



----------
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell]
@=""

[HKEY_CLASSES_ROOT\*\shell\bury]
@="Bury"

[HKEY_CLASSES_ROOT\*\shell\bury\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,67,00,70,00,67,00,65,00,6e,00,63,00,72,00,79,00,70,00,74,00,2e,00,\
  65,00,78,00,65,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\Applications\bury.exe]

[HKEY_CLASSES_ROOT\Applications\bury.exe\shell]

[HKEY_CLASSES_ROOT\Applications\bury.exe\shell\open]

[HKEY_CLASSES_ROOT\Applications\bury.exe\shell\open\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,62,00,75,00,72,00,79,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,\
  31,00,22,00,00,00


22
I hacked up a quick program last week that lets me plug in my external hard drives, one at a time, and scans them to extract the file names which it writes to a CSV file.  (The code is specifically looking for video files and DVD images, but remove that restriction and it could catalogue anything).  It works well enough and was just what I needed (finding something on an external drive is tedious when you have more than a handful of them and can't plug them all in at once...), but it's a command-line utility and it would be more friendly to release it as a Windows GUI program.

If anyone feels like wrapping a Windows GUI around this thing, here's the source code.  There's a tiny amount of documentation in the top of the C file as comments.

http://www.gtoal.com/src/videocat/

I looked fairly hard and I couldn't find any existing utility that scans drives like this and outputs in a form that a DVD Library Manager could import.

I'm a fairly experienced old-time programmer but I'm sticking with command-line stuff and algorithm development; I really don't have a lot of interest in learning GUI programming myself and from what I've seen of the M$ interface, nowhere near enough free time to learn it all either :-/  However I write *lots* of utilities and would welcome working with people who enjoy M$ programming and find the GUI side of things easy...

Thanks,

Graham <[email protected]>

Pages: prev1 2 3 4 [5]
Go to full version