FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour REGISTRY commands
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
REGISTRY commands
Posted: Tue Nov 23, 2010 12:55 PM

I must insert a value into registry

         oReg := TReg32():New(HKEY_CURRENT_USER, Key)
         oReg:Set(Name,valore)

but here it not run because not found the variable into registry

what is the command to say " IF NOT FOUND THE name of variable create it " ?

I try with

IF ! FOUND (name)
oReg:Create( nKey, cRegKey )

but not run ok

then if insert oReg:ENd() it make error ...

Best Regards, Saludos



Falconi Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: REGISTRY commands
Posted: Wed Nov 24, 2010 08:08 AM
// to hide the monitor property

Function main()

Key:="Software\Microsoft\Windows\CurrentVersion\Policies\System"
Name:="NoDispSettingsPage"
valore:=1


IF RegOpenKey( HKEY_CURRENT_USER,Key, @nHandle ) == 0
oReg := TReg32():New(HKEY_CURRENT_USER, Key)
oReg:Set(Name,valore)
ELSE
oReg := TReg32():New(HKEY_CURRENT_USER, Key)
oReg:Create( Name, valore )
endif


return nil




THe PROBLEM is IT not found System of Key
how I can to create this ?
Best Regards, Saludos



Falconi Silvio
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: REGISTRY commands
Posted: Mon Nov 29, 2010 07:54 PM

What version of Windows ? Starting with Vista ( and now Win 7 ), Registry entries go to Roaming. Thus, they are not where I want them placed. I finally gave up on the Registry and use a file on the server for my data.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: REGISTRY commands
Posted: Tue Nov 30, 2010 08:51 AM

tim please see here viewtopic.php?f=3&t=20401&p=108171
on xp professional run ok
and try it and see on wich window it can run ok

Best Regards, Saludos



Falconi Silvio
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: REGISTRY commands
Posted: Tue Nov 30, 2010 04:56 PM

I only have Win 7 on my computers now. However, I abandoned using the Registry with Vista, and now use a configuration file. It actually works out much better. For local machines, I use a text file, and on the server I use a dbf with a single record.

No matter what I tried, I was not getting Registry entries to go where I wanted them. Instead they went where Microsoft wanted to place them, and when I tried to read in the original location, of course they are not there. Do a Find in the Registry editor and see where they were placed.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: REGISTRY commands
Posted: Wed Dec 01, 2010 10:42 AM

Timm,

Sorry for my english ..

At school I need a procedure to block each computer because my boys must use only WINWORD and EXCEL instead they use the other application of window changing the configuration ( screensavers,desktop,...)

I making a procedure to block these features ...at school we have only win2000 and Win Xp

I found a file help (Windows Registry Guide 2003) and on some feature there is wrote "All Windows" and I 'd like to see ( when I finished my procedure) if it run on wich system ....

Best Regards, Saludos



Falconi Silvio
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: REGISTRY commands
Posted: Wed Dec 01, 2010 01:37 PM
Are you familiar with Windows Group Policies and Software Restriction Policies?

http://www.dedoimedo.com/computers/policies.html

Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: REGISTRY commands
Posted: Wed Dec 01, 2010 06:14 PM

James,
yes I Know this but we not have all windows NT...
but I want create it from fwh source code and not set manual each computer ...

I have at my school 16 Laboratories and each Laboratory have 30 computers...
and on each room we have until 3 computers for an total ammout of 460 computers...then we must calc also 34 netbooks, 12 latop, 10 old latop...

How Many time I must lose to set all pcs ?

Best Regards, Saludos



Falconi Silvio
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: REGISTRY commands
Posted: Thu Dec 02, 2010 09:19 AM
Silvio,

you can create a .reg file and insert your settings from your program with
Code (fw): Select all Collapse
winexec ("regedit /s Settings.reg", SW_HIDE )
kind regards

Stefan
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: REGISTRY commands
Posted: Thu Dec 02, 2010 11:10 AM
STEPHAN
I created somethnig of it
SCHOOL ADMIN SOFTWARE

SOME SNAPSHOTS








HIDE /SHOW DEVICES

Best Regards, Saludos



Falconi Silvio

Continue the discussion