|
-
Jun 2nd, 2000, 11:45 PM
#1
Thread Starter
transcendental analytic
How do i put 2 or more icons in my compiled exe?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 3rd, 2000, 03:17 AM
#2
You can add Icons to a RESOURCE file which gets compiled into your EXE the First Icon resource then replaces your EXE icon and the others are accessable via an Index.
-
Jun 3rd, 2000, 04:04 AM
#3
Thread Starter
transcendental analytic
Thanks, do you know how to update the filetypes too? That would help me much
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 3rd, 2000, 08:03 AM
#4
Sure...
Sure,
Use the SHChangeNotify() API with the SHCNE_ASSOCCHANGED Constant, i.e.
In a Module:
Code:
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function SHChangeNotify Lib "shell32.dll" (ByVal wEventID As Long, ByVal uFlags As Long, ByVal dwItem1 As String, ByVal dwItem2 As String) As Long
Private Const HKEY_CLASSES_ROOT = &H80000000
Private Const SHCNE_ASSOCCHANGED = &H8000000
Private Const SHCNF_IDLIST = &H0
Public Sub AssociateMyApp(ByVal sAppName As String, ByVal sEXE As String, ByVal sExt As String, Optional ByVal sIcon As String)
Dim lRegKey As Long
'Open/Create the Extension under the "HKEY_CLASSES_ROOT" Hive of the Registry
Call RegCreateKey(HKEY_CLASSES_ROOT, sExt, lRegKey)
'Set the "Default" value of the Key to the Application Name
Call RegSetValueEx(lRegKey, "", 0&, 1, ByVal sAppName, Len(sAppName))
'Close the Registry Key
Call RegCloseKey(lRegKey)
'Create the Application Key in the "HKEY_CLASSES_ROOT" Hive of the Registry
Call RegCreateKey(HKEY_CLASSES_ROOT, sAppName & "\Shell\Open\Command", lRegKey)
'Set the Command to the EXE
Call RegSetValueEx(lRegKey, "", 0&, 1, ByVal sEXE, Len(sEXE))
'Close the Registry Key
Call RegCloseKey(lRegKey)
'If an Icon is required...
If Len(sIcon) Then
'Create a "DefaultIcon" entry under the Association Key
Call RegCreateKey(HKEY_CLASSES_ROOT, sAppName & "\DefaultIcon", lRegKey)
Call RegSetValueEx(lRegKey, "", 0&, 1, ByVal sIcon, Len(sIcon))
Call RegCloseKey(lRegKey)
End If
'Notify the Shell that an Association has Changed, (Updates Icons).
SHChangeNotify SHCNE_ASSOCCHANGED, SHCNF_IDLIST, vbNullString, vbNullString
End Sub
Example Usage:
Code:
AssociateMyApp "Kedamans Application", "C:\Files\Kedaman.exe %1", ".kdm", "C:\Files\Kedaman.exe,-1"
- Aaron.
-
Jun 3rd, 2000, 04:33 PM
#5
Thread Starter
transcendental analytic
Thanks alot, i needed that shchangenotify part
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 4th, 2000, 06:14 AM
#6
Thread Starter
transcendental analytic
Another Q, how can i drag a file on another, which should start my app? Winzip does it, so it's not impossible!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 4th, 2000, 06:37 AM
#7
If you drag a file onto an Executable then it'll start the Executable and pass the Dropped files filename and path as a Command Line, so you can us it in your application using the "Command" keyword.
-
Jun 4th, 2000, 05:28 PM
#8
Thread Starter
transcendental analytic
No no, I have done that already but how do i drag one file on another (not executable) like winzip, you can drag a file on a zip extension. There's a shellex key in the registry and i tried to copy it to my datatype but it didn't work...
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|