I have a client application in C++. For that I want to create a shortcut on the desktop and an entry in the start menu while installing. Is there any C++ windows api for that? I tried searching for it but couldn't find it. Can anyone tell me how it can be done?
You'll have to get your hands a bit dirty, and use COM to access the Shell. You can read here about Shell Links. Also, this project might provide you the code you need.
To get the location of the desktop and the start menu folders, you can use the appropriate System Variables.
Related
Im trying to make (what I thought was a simple) extension for Game maker studio 2.
I am restricted to making a DLL app.
I am wondering is there any was to have a dll app open the file explorer have the user locate a file and then return said directory?
I fell like this is a sumb question but one I really need to know the answer too before slaving away coding for hours only to find its not possible.
You do not want to launch the explorer but to open a file dialog that allows the user to select a file.
Depending on the framework you use in your program the solutions may differ.
If you are using Qt framework you may use a QFileDialog for a platform independent mechanism.
If you are okay that it will only works on Windows then you may directly use the WinAPI functions GetOpenFileName or GetSaveFileName (that is a lot easier than the Common Item Dialog that is suggested as replacement on their documentation pages)
On GameMaker terms, you want to use get_open_filename or get_open_filename_ext.
See Dialog Module (marketplace, github) for C++ implementation reference.
i want to be notified when when user trys to open a file from the explorer.
How could this be done?
I tired hooking some winapi in the explorer.exe with no hope.
I also want to intercept this call and cancel it.
You might want to have a look at a similar question: Intercept windows open file
Also for the people asking why someone would want to do this or immediately jump to malware conclusions. There are a number of legitimate uses for this. Especially if you are creating a B2B product that deals with automation or control over a customer's PC environment.
I want to create an editor in C++ using SDL & OpenGL and have decided to use the win32 api to access the window bar menus (for file, edit and so on) and it seems quite simple, but I don't know how to create a "file-> open" file browser/loader... I'm hoping it's quite simple but I'm finding it hard to look up any tutorials on google because of the phrasing...
I just want to have an "open" or "import" option in the file menu that will open a standard windows file browser... then grab the file location, place it into a string then pass it into a function that is activated by selection a file... (I hope that makes sense).
The method I'm using to create the win32 menus are from this post:
http://www.gamedev.net/topic/400677-sdl-with-a-win32-menu/
Half way down the page there is a comment by "caseyd"... that's how I learnt how to use it, so that is my current understanding of win32 menus in SDL... I wanted to post the code here, but I didn't know how to paste it here in codeblocks without reformatting every line.
I'm hoping this is quite simple... Thanks to anyone who can teach me how or just point me in the right direction.
Oh, and I'm not trying to convert this to other operating systems, I just like SDL.
Use GetOpenFileName(). Note that that function blocks until the user selects a file, so if you want to continue rendering etc. in the background, make sure to run it on a separate thread.
I don't want to associate extension but Folder. So that when I click on Desktop to tell OS to use my application, and not Explorer.
I've tried to substitute in HKEY_CLASSES_ROOT\Folder\shell\open\command explorer.exe with my program but it's not working properly cause then I open with my application also Control Panel and other stuff, which is not what I want.
Thanks!
What you want to do can be achieved by implementing a custom IShellFolder. http://msdn.microsoft.com/en-us/library/windows/desktop/cc144093(v=vs.85).aspx has the details . At a minimum you have to implement
IPersistFolder Interface
IShellFolder Interface
IEnumIDList Interface
This is what for example the Google Drive uses
Folder ProgID denotes any folders, including non-filesystem ones. Correct ProgID for your case is Directory.
Reference
I am newbie in WinCE Programming, i want to Create Custom File Dialog for our application, which has totally diffrent look and feel than the default windows file dialog....
I looked into many Flag value bt they won't worth it ...
Any pointers will be helpful
Thnks...
Mukesh
It depends on what level you're looking at replacing it. Do you want to replace it device-wide, or just for your app? If it's just for your app, create a new Dialog with the features you want and call it.
To replace it system-wide you have to have the ability (i.ee tools and BSP) to create a new OS image. You would clone the following folder in your project tree:
%WINCEROOT%\PUBLIC\SHELL\OAK\HPC\CESHELL\UI
Then modify the resource (and potentially code) files you want changes and rebuild your OS.