Monday, July 27, 2009

How to read the properties of a short cut file using c++ (short cut has state modes as minimized...)?

I want to read the properties of a shortcut file. we can set the state of the application as minimized, maximised or normal. Depending on this information our application behaves. I want to read those state properties using c++ language. And I want another one also, if an application has 2 or more number of shortcuts and is opened using one of those shortcut files, is there any way to recognize that shortcut file path.

How to read the properties of a short cut file using c++ (short cut has state modes as minimized...)?
You could try and reverse engineer a shortcut file. It's a binary file, so make sure to open it up in a hex editor. Well, you're not the first one to deal with shortcut files, so http://www.google.com/search?q=windows+s... shows that this is Googleable.





But I get the horrible feeling you don't know what you're doing. Are you talking about the parameters that get passed in? Like myprog -maximized? Those are the command line arguments. If it's a console app, then they are in char** argv. You know, the full form of main(int argc, char** argv). No need to read shortcut files. That information is available to your program when it starts.





%26gt; is there any way to recognize that shortcut file path.





Uhh, I don't recall what exactly argv[0] is. If it's just the program name, that's useless, and the same is true if it's the path to the program. But if it's the path used from the prompt, you might be in luck. The current working directory should be set by the environment though, so look up reading environment variables in C/C++. Something along the lines of getenv (http://www.cplusplus.com/reference/clibr... ).
Reply:Hi,


My applicaiton is windows application not command prompt.


I want to get the shortcut file path also in application Report It

Reply:Not sure whether you can do it check APIs of ifstream

hydrangea

No comments:

Post a Comment