Link to home
Start Free TrialLog in
Avatar of robjgreen
robjgreen

asked on

Help needed asap.

REPLIES ARE NEEDED URGENTLY TO THIS QUESTION.

Hi all,
  need to know how to do the following:

  Make and delete directories
  Make and delete files
  Make, Edit, and Remove Registry Keys.

Kind Regards,
Rob Green.
Avatar of Dalin
Dalin

Rob,
Create file: Open filename for Output/append
Delete file: Kill filename
Create dir:  MKDir dirPathName
Delete Dir:  RMDir DirPathName
Create Regi: RegCreateKey API
Delete Reg:  RegDeleteKey API

Let me know if I can help further
Regards
Dalin
BTW, I send you some questions regarding your code. Have you got it? I guess you are about 5 hours ahead of me (I am in US, Eastern time zone).
Rob,

To save/create a registry settings:
SaveSetting("appname_here", "App section here", "LastNoConnect", sLastConnectTime)

To read a registry setting:
sLastConnectTime = GetSetting("appname_here", "App section here", "LastNoConnect", "")

Joe
Avatar of robjgreen

ASKER

Dalin, can you give examples? I am useless with api.
ASKER CERTIFIED SOLUTION
Avatar of usermiles
usermiles

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Beware, you usually want to use the Ex versions of the registry functions (e.g. RegSetValueEx). The older functions can only set REG_SZ type keys and can't deal with the multiple named values under a single key that is how much of the 9x/NT registry is set up.
Thanks guys, pity I cant split the points between you though. If anyone can recommend a book on API I would be very grateful because the microsoft books "Step by Step" and "Programmers Guide" dont really contain much advanced info.

Kind Regs,
Rob Green.
Rob,
Sorry I was unable to follow up. I had to go to a "Radiation Safty training" offsite all afternoon.  I am glad usermiles was able to give you examples.

Just a comments on APIs, You can have the API viewer (comes with VB) and load the WIN32API.txt file, and look for the API you need, it will give you the proper declaration. you can copy it to your VB code.

You can also find all the explaination of the API's in microsoft's MSDN online library.
Regards
Dalin
Regarding to book, Dan Appleman's book is a good one:
VB5 Programmer's Guide to the Win32 API.
Thanks again all....

Anybody know why it puts the directory under VB and VBA though rather than its own key?

Also, if anybody has any ideas on a twenty day trial system then I would be mucho glad. No need for password protection etc, already done that part of it.

Kind Regs,
Rob Green.
I would recommend the Dan Appleman's book for VB4.0 it actually gives better examples for the API functions, it is the same as VB5 but with a little better detail...

Miles
Rob,
I had trouble to logon myemail.
Here is what you do for add to the start menu:

'Declare:
Private Declare Function fCreateShellLink Lib "vb5stkit.dll" _
    (ByVal Forder As String, ByVal ShortCutName As String, _
     ByVal ExePath As String, ByVal Params As String) As Long


'Code
 Dim ret As Long
' add shortcut to DeskTop
' ret = fCreateShellLink("..\..\Desktop", "TheNameAppear", "YourAppwithPath.exe", "")

 'To the system Start Menu
 ret = fCreateShellLink("..", "CodeBank", "c:\Dalin\VBUtil\CodeBAnk\CodeBank.exe", "")