0

I am making a program that stores information in a file with a custom extension. I was wondering If it is possible to assign it an icon within the program so that the icon will show the file with the icon anywhere on the computer? For example how all Microsoft word documents have the word icon.

Zabuzard
  • 25,064
  • 8
  • 58
  • 82
  • This question has been asked before ,here is the link https://stackoverflow.com/questions/2428958/custom-file-type-and-icon – user8271644 Jul 25 '17 at 01:42
  • Definitely possibly by using **JNI** to access the **Windows-API**, done that before. However I think there are already APIs or stuff like that available... Done here in C++ using Windows API: [Setting program icon without resources using the WIN32 API](https://stackoverflow.com/questions/18314659/setting-program-icon-without-resources-using-the-win32-api) – Zabuzard Jul 25 '17 at 01:42
  • 1
    Possible duplicate of [Custom file type and icon](https://stackoverflow.com/questions/2428958/custom-file-type-and-icon) – Am_I_Helpful Jul 25 '17 at 01:43
  • @user8271644 No, it's not the same question. That one is all about having an icon for a file type. This one is about doing it on a file-by-file basis. – Dawood ibn Kareem Jul 25 '17 at 01:43
  • My understanding is that in Windows, you can set the icon for any shortcut, including a folder shortcut, and you can set it for EXE and DLL files, and you can set it per-type for any other file type; but you can't set it for individual non-shortcut files other than EXE and DLL. It may be possible in other operating systems. In any case, the answer to this question is sure to be operating system dependent. – Dawood ibn Kareem Jul 25 '17 at 01:46
  • @Zabuza How can you be sure that Gerry is asking about Windows? I voted to reject your edit, because you _may_ be changing the intention of the question. – Dawood ibn Kareem Jul 25 '17 at 01:54
  • I guessed from "*Microsoft word documents*" but you could be right. OP please clarify which system you are talking about. – Zabuzard Jul 25 '17 at 02:02

0 Answers0