There is 1 way of doing it but it'd probably take quite a while ( a few months for Windows notepad) (a few years for Adobe Photoshop). But here's what you'd have to do:
1 - Debug the application; I mean debug it from memory reference 0000 to xxxx. Windows debug, I think, allows you to do this, otherwise you need a debug app like GDC to open the app and run it through.
2 - You have to know Assembly to figure out what the instructions are.
3 - Figure out what language you'd program it in, decide how to define the variables (int, double, char, char *, etc.) and how to flow the program.
4 - Actually program the program taking all the information from 3 and 2 to write it all - including the specific libraries if any are used etc. etc.
All in all its worthless. It'd be better to just program your own app in java bc Java is cross-platform and needs no recompiling.