You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
sorry I'm a registry novice I looked through the Win32Api help file and it is not easy to understand. Peter, I didn't know how the SendTo menu work; now I'm puzzled on two more questions:
1- How to create a shortcut file by program
2- Where to write it - that is, how to get the USER path to reach the SendTo folder
(and, of course, I still need help on the automatic extension files process on esplorer).
I work with SendTo without using the registry:
Just copy a shortcut to your program to the SendTo-folder.
In your program you can obtain the file name by using command$.
If multiple files is selected, you get a " "-delim. list.
The only problem is that if too many files is selected, an
error occurs.
Peter, thanks a lot - Now I know the correct way to manage the registry entries.
Now I need the registry key names to do what I want. That is, the keys to add an entry to the SendTo menu, and the keys to link a file extension to an application program.
function SetRegistry(byval hKey as long, byval sSubKey as string, byval sValueName as string, byval sValue as string) as long
local hResultKey as long
local result as long
local zText as asciiz * 2048
' ** Create the section
if RegCreateKeyEx(hKey, sSubKey & chr$(0), 0, "", _
%REG_OPTION_NON_VOLATILE, %KEY_ALL_ACCESS, BYVAL %NULL, _
hResultKey, Result) <> %ERROR_SUCCESS then exit function
' ** Save the value for the key
if len(sValue) then
zText = sValue
RegSetValueEx hResultKey, sValueName+CHR$(0), 0, %REG_SZ, zText, LEN(sValue)+1
else
RegSetValueEx hResultKey, sValueName+CHR$(0), 0, %REG_SZ, BYVAL %NULL, 0
end if
' ** Close the key
RegCloseKey hResultKey
function = 1
end function
function GetRegistry(byval hKey as long, byval sSubKey as string, byval sValueName as string, sValue as string) as long
local hResultKey as long
local result as long
local keytype as long
local buffer as string * 2048
local size as long
' ** Open the section
if RegOpenKeyEx(hKey, sSubKey & chr$(0), 0, %KEY_ALL_ACCESS, hResultKey) <> %ERROR_SUCCESS then exit function
' ** Get the key value
size = SIZEOF(buffer)
result = RegQueryValueEx(hResultKey, sValueName + CHR$(0), 0, keytype, buffer, size)
' ** Close the registry
RegCloseKey hResultKey
' ** Exit if not successful or nothing there
if (result <> %ERROR_SUCCESS) or (size = 0) then exit function
' ** Return the data
if keytype = %REG_SZ then
sValue = left$(buffer, size - 1)
else
sValue = left$(buffer, size)
end if
function = 1
end function
I would like to add a PB program the two following capabilities (bBoth capabilities should be enabled/removed as a response to DDT checkboxes):
1 - Add/remove an entry to the Send To menu
2 - Create/delete the automatic link to the file extension (double-clicks on explorer)
I think I must use the registry, both write and read (read to get the initial status of my checkboxes inside the DDT). Can someone tell me the main "tricks" to do this? Any help would be greatly appreciated.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: