Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / File type registration for windows

Author
Message
SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 6th Nov 2010 17:59
i see looking in the oldest threads that file association has not been coded to a dll yet. It just so happens i have such a dll file that does the trick written by Rudolpho for the original qmidi music program.

What it does is register a file extension eg. [.mid] to auto load with my application. It will also register a bmp file icon to that file type.

The only issue i see with it is that it crashes if compiled under windows vista.... however if its compiled under xp it seems to run over all operating systems.

I was thinking it can be a seperate exe file inside the same folder as your main application. You can call on the exe and create an ini file for it to register any file types nessesary then close and return back to your app...

Any thoughts?

The program when run it is minimized and is shown for ~1 second then its done and closes. Again the only reason i want to release it like this is because when compiled under vista or 7 it seems to crash. If its compiled under xp it seems to work.

Is this something you guys can use for your applications?
eg. if i make a map level file for my editor i will be able to click on the map file and auto load the level editor and auto load that map file.

Development & Editting
SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 6th Nov 2010 19:16 Edited at: 6th Nov 2010 19:48
For windows xp users i can just release the dll itself. but keep in mind it will not compile properly under vista or 7 as far as i know. Could be that another library is not present but im not sure.

using this dll:

`initialize plugin
INIT QMIDI 3435973836

`register file type command
`example
REGISTER FILETYPE ".mid", "Qmidi Studio","Music file type", getappdir$()+"/Qmidi Studio.exe", getappdir$() + "/fileicon.bmp"

`this will register your app file type to windows.
`1 function required for using
function getAppDir$()
local s as string
s = appname$()

for p = len(s) to 1 step -1
if mid$(s, p) = "\" then exitfunction left$(s, p - 1)
next p

endfunction ""

`thats it do some testing with it and see how it works.


now for inside your application you will need to check and see if a file is auto loading with it. use this command to check.

if cl$()<>"" then qlen=len(cl$()):bob$=left$(cl$(),qlen-1):quickld$=right$(bob$,qlen-2)

`now the contents of quickld$ contains the file that needs to be loaded automaticaly

Questions....comments?


place this dll in the plugins-user folder of your compiler

All thats asked is that you give Rudolpho credit if used... Hes a great coder that deserves credit.


I will compile my other plan on an xp machine and explain how it works shortly for the vista and 7 users...


edit: i take that back... it seems to work on xp and vista but needs to be run as the administrator. Possible UAC may also need to be disabled

Development & Editting

Login to post a reply

Server time is: 2026-07-26 05:03:42
Your offset time is: 2026-07-26 05:03:42