Could someone point me to where the Windows source code for the al_create_native_file_dialog() function is? I want to dig through it and see if I can improve it, at least for my own needs anyhow.
(preferably without any sarcasm)
Look in the add-ons native dialog folder.
Or, if you have git installed:
git grep al_create_native_file_dialog
addons/native_dialog/dialog.c line 43
although you are probably more interested in _al_show_native_file_dialog which is in
addons/native_dialog/win_dialog.c line 135
Thanks. I may be in over my head here. Trying to figure out how I can get this thing to accept a default filename when opening a save dialog. :/
GetOpenFileName is called on a OPENFILENAME structure. It looks like the lpstrFile field needs to be initialized for it to accept a default selected file.
What allegro does currently :
Thanks for trying to help out! It will be easiest if you clone Allego's git repository, so you can make a patch easily with git diff or git format-patch. The Allegro Git repository is explained here:
lpstrFile is a LPTSTR type, which is dependent on whether UNICODE is defined before including windows.h. UNICODE is not currently defined in any files included in win_dialog.c. That makes LPTSTR a typedef for unsigned char*[1]. So it should be okay to use a char* str in its place, I think...
So, we can set lpstrFile to the filename held in fc_initial_path I believe. I will test this later tonight.
Edit
Still working on this. Been busy with orientation for school.