Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Creting Your Own Format
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DIIST




PostPosted: Sun Dec 10, 2006 1:08 pm   Post subject: Creting Your Own Format

My compiler: someting Borland.

Basically i created my own format .thuvs, which is can do multiple things like hold image data, music,etc. Rolling Eyes. The Problem is i want to make it so that when ever you click a file with the extension ".thuvs", it will call my progy. How do you do that? I know the classically way is to just go rightclick->OpenWidth->Allways open this file with..., but how do you make it so the when you first run the program it automatically assigns it to be the default program to open any ".thuvs" with? Plus how the hell do you read the file when your prgy is run. Do you get the fileinfo from run args Confused
Sponsor
Sponsor
Sponsor
sponsor
JakeP




PostPosted: Tue Dec 12, 2006 11:48 pm   Post subject: (No subject)

I'm going to assume you're in Windows.

If I remember correctly that info is stored in the registry (urg)
Clayton




PostPosted: Wed Dec 13, 2006 2:06 pm   Post subject: (No subject)

well I don't know about coding it, but you can right click on the icon -> Open With, choose the program from the list, and click the little box that says use this program all the time (or something similiar)
DIIST




PostPosted: Thu Dec 14, 2006 12:24 pm   Post subject: (No subject)

Forget reading form the file i figured out how to do that part, but still, isnt there anything like a packager or an installer that can do this for you, instead of manulay clicking it. I mean it be cooler if you could just click any file with the extension and it would just open and run. Instead of asking the user to rightclick and do this for you. I mean where the user friendly interface in that? Laughing
Mazer




PostPosted: Thu Dec 14, 2006 5:12 pm   Post subject: (No subject)

JakeP already said it. You'll need to play around with the registry. More than that, I don't know; let Google be your guide.
md




PostPosted: Thu Dec 14, 2006 7:38 pm   Post subject: (No subject)

Linux doesn't have a registry, I don't know what you people are talking about anyways; nautilus, thunar (xfce4's file browser), and kde's file browser all recognize file types on their own, independent of extension sometimes. If they don't know how to open things they ask once and remember what you choose (I think windows will do that too).

Whatever it is your doing however; you have to ask yourself if creating a new file type is actually worth it. There are a lot of standard formats out there which will do almost anything you could want.
Andy




PostPosted: Thu Dec 14, 2006 7:58 pm   Post subject: (No subject)

who said he was on linux?
md




PostPosted: Thu Dec 14, 2006 8:41 pm   Post subject: (No subject)

Andy wrote:
who said he was on linux?
And who said he was using windows? I was making the point that everyone (correctly) assumed windows; and even if everyone is right, those of us who use linux still feel left out.

My point about not really needing to create your own file type still stands. Even if you do need to create your own format you might not need to assosiate it with your program. For things like games loading a save from outside the game is not usually needed.
Sponsor
Sponsor
Sponsor
sponsor
bugzpodder




PostPosted: Thu Dec 14, 2006 8:54 pm   Post subject: (No subject)

Does anyone know ppl from MS? I want to buy vista and office 07 at a cheap price Smile
ericfourfour




PostPosted: Thu Dec 14, 2006 10:26 pm   Post subject: (No subject)

If you really want a "multi-use" format, why not use .rar, .zip, and etc.? I'm sure there are libraries written for them as well.
Mazer




PostPosted: Fri Dec 15, 2006 9:29 am   Post subject: (No subject)

bugzpodder wrote:
Does anyone know ppl from MS? I want to buy vista and office 07 at a cheap price Smile

Wow, wtf?
DIIST




PostPosted: Fri Dec 15, 2006 6:26 pm   Post subject: (No subject)

Im using windows, and im wondering if anyone knows how you can alter the regesty using C. I did try googling it but ended up with a lot of confusing stuff with warnings and disclaimers.
Cool
Andy




PostPosted: Mon Dec 18, 2006 5:04 am   Post subject: (No subject)

pass your regkey as arguments to regedit.exe or

or create a regfile. system("regedit test.reg") where test.reg is the name of your regfile. for sample of what reg file should look like:

code:

REGEDIT4

; =======================
; Coolbits 2
; >> Installation File
; =======================

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\NVTweak]
"NvCplExposeWin2kDualView"=dword:00000001
"NvCplTvLocaleAutoDetect"=dword:00000001
"NvCplAllowForceTVDetection"=dword:00000001
"NvCplEnableActiveApp"=dword:00000001
"DisableApplyColorsAtStartup"=dword:00000000
"NoMenus"=dword:00000000
"OverlayPageState"=dword:00000000
"CinematicPageState"=dword:000000ff
"NvCplThermalSettings"=dword:00000020
"NvCplEnableScreenMenuPage"=dword:00000001
"NvCplCustomResConfig"=dword:00000000
"NvCplEnableAdditionalInfoPage"=dword:00000001
"NvCplDisablePerfQualPage"=hex:00,00,00,00
"NvCplEnableAGPSettingsPage"=dword:00000001
"CoolBits"=dword:ffffffff
"NvCplEnableOverlaySpanControl"=dword:00000001
"TwinViewCapsOverride"=dword:00000001
"NvCplEnableDesktopOverlapPage"=dword:00000001
"NvCplEnableTroubleshootingPage"=dword:00000001
"NvCplDisableRefreshRatePage"=dword:00000000
"NvCplDisableRotateAngles"=dword:00000000
"NoPages"=dword:00000000
"NvCplEnableClearViewPage"=dword:00000001
"NvCplEnableFanControl"=dword:00000003
"NvCplEnableFrameSyncPage"=dword:00000001
"NvCplEnableHardwarePage"=dword:00000001
"NvCplEnablenForcePage"=dword:00000001
"NvCplEnablePwrMzrOnDesktopMenu"=dword:00000001
"NvCplEnableRotationColorSettings"=dword:00000001
"NvCplNvThermPage"=dword:00000001
"PowermizerPreferences"=dword:00000000
"QTwkEnableModeChangeWarning"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\OpenGL]

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\OpenGL\Debug]
"ShaderObjects"=dword:00000001
haskell




PostPosted: Wed Dec 27, 2006 2:04 pm   Post subject: (No subject)

If you want a quick fix on Windows:

code:

- Open "My Computer"
- Then on the Menu bar click Tools -> Folder Options
- Click the "File Types" tab.
- Then you can click "New
- Put in the file extension and the program to associate it with.


Also if you can use this Google search.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 14 Posts ]
Jump to:   


Style:  
Search: