473,836 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Window Registry

Sam
Hi all

If I only want to store screen location and size of my application in
Windows Registry, which of the keys should I store this info? A sample code
is greatly appreciated. Thank you

Regards,

Sam
Nov 21 '05 #1
17 1610
"Sam" <qd*@datawave.c a> schrieb:
If I only want to store screen location and size of my application in
Windows Registry, which of the keys should I store this info?


You can use 'Microsoft.Win3 2.Registry' to store data in the registry. For
more information, read the documentation of this class. If you have any
further questions on this topic, feel free to post them here.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
Sam
Hi Herfried

Thanks for the response. I think my question wasn't that clear and I'm a
little confused, so let me rephrase it. when I ran regedit on my Window run
command, I saw 5 major groups:

1. HKey_Classes_Ro ot
2. HKey_Current_Us er
3. HKey_Local_Mach ine
4. HKey_Users
5. HKey_Current_Co nfig

Now if I use classes Registry and RegistryKey to access and store my
application specific, which of the above should I store my application's
size and location? Is there a convention for this? I'm new to this

Regards,

Sam
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
"Sam" <qd*@datawave.c a> schrieb:
If I only want to store screen location and size of my application in
Windows Registry, which of the keys should I store this info?


You can use 'Microsoft.Win3 2.Registry' to store data in the registry. For
more information, read the documentation of this class. If you have any
further questions on this topic, feel free to post them here.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
Sam,

Dim Reg As RegistryKey
Reg = Registry.Curren tUser.CreateSub Key("Software\S am\Whatever")
Reg.SetValue("W idth", pW)

http://msdn.microsoft.com/library/de...toregistry.asp

I hope this helps?

Cor
Nov 21 '05 #4
"Sam" <qd*@datawave.c a> schrieb:
Thanks for the response. I think my question wasn't that clear and I'm a
little confused, so let me rephrase it. when I ran regedit on my Window
run
command, I saw 5 major groups:

1. HKey_Classes_Ro ot
2. HKey_Current_Us er
3. HKey_Local_Mach ine
4. HKey_Users
5. HKey_Current_Co nfig

Now if I use classes Registry and RegistryKey to access and store my
application specific, which of the above should I store my application's
size and location?


'CurrentUser'. Take a look at the documentation of the 'Registry' class'
members. You will find information on which data to store in which of these
registry branches there.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
Storing configuration parameters in Registry is not recommended anymore.
Your should use a XML file instead. But, for reference:

Each registry hive plays different roles. CurrentUser is used to store
personal information about the user currently logged in the system. Each
user has a CurrentUser. A user has full access to its CurrentUser. No user
can access the CurrentUser of another user. LocalMachine is global to any
user logged in, but only members with administrative priviledges can write
to it. Other users, non administrators, can only read the keys stored in
LocalMachine. Usually, you shold pick one of this too, depending on the kind
of information your are storing and the level of access required. As it
seems, if yours configuration is read-only to non administrators users, the
best location for your configuration is LocalMachine. But remember: ordinary
users running your application will not be able to change any key or value.
If this is required, use CurrentUser. This only apply to Windows NT, Windows
2000, Windows XP and Windows 2003. In Windows 9x e Me, any user has full
access to all registry keys, including LocalMachine.

"Sam" <qd*@datawave.c a> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
Hi all

If I only want to store screen location and size of my application in
Windows Registry, which of the keys should I store this info? A sample
code
is greatly appreciated. Thank you

Regards,

Sam

Nov 21 '05 #6
"Sam" <qd*@datawave.c a> wrote in message
news:uj******** ********@TK2MSF TNGP14.phx.gbl. ..

1) Is the machine on which this app is running shared by multiple users?
If it is not, use HKey_Current_Us er.

2) If it is, do you want the settings to apply to all users who share the
machine?
If you do, use HKey_Local_Mach ine.
If you want each of the users who share the machine to be able to have
individual settings, use HKey_Current_Us er.
Nov 21 '05 #7
"John Smith" <fa*******@hotm ail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Storing configuration parameters in Registry is not recommended anymore.


Not recommended by whom?
Nov 21 '05 #8
Mark,

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> schrieb:
Storing configuration parameters in Registry is not recommended anymore.


Not recommended by whom?


Using the registry is still recommended.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #9
Sam
Hi Mark

Thanks for the explanation. Ideally I'd like to have the application running
on the machine shared by multiple people and each should have their own
settings. What I'm not sure is how complicated this could be since this is
new to me. I guess if I choose to implement this way, I need to create
something like
HKey_Current_Us er\Software\MyA pplication\User ID1\MyAppLocati on?

If the above is too complicated, I might just go down the path that apply
the settings to all users.

Regards,

Sam

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:eh******** ******@TK2MSFTN GP14.phx.gbl...
"Sam" <qd*@datawave.c a> wrote in message
news:uj******** ********@TK2MSF TNGP14.phx.gbl. ..

1) Is the machine on which this app is running shared by multiple users?
If it is not, use HKey_Current_Us er.

2) If it is, do you want the settings to apply to all users who share the
machine?
If you do, use HKey_Local_Mach ine.
If you want each of the users who share the machine to be able to have
individual settings, use HKey_Current_Us er.

Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2473
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's context menu when you right-click over a folder (or the drive root). The menu item text is "Open .Net Command Window Here". When you click it, it opens a command window positioned at that directory and runs the vsvars32.bat file to set the .Net Framework environment variable settings. This makes it...
44
4752
by: Carlos Andr?s | last post by:
Hi everybody. I've got a problem. I'd like to avoid opening a new window when you have pressed the shift key and you click in the left button of the mouse. I've tried the next solution, in the body of the page I put the next code: <BODY onkeydown='notOpenNewWindow();'>
4
5987
by: JeffP | last post by:
I want to add a short-cut to a windows app similar to launching from a windows run line a New window, to prevent changing an existing browser window from moving off a current logged in session to another web application. And, I'd like it to be a chromeless window, sans toobars and sized similar to a popup. TIA
7
7285
by: BW | last post by:
Hi all! I'm not sure where to post this so I'm giving these a try. If there is a better (more appropriate) place to post please let me know. I want to create a service (in C#). The service's purpose is to monitor a given service, and when the service becomes disabled and/or stopped I want to restart the service. I have figured out how to restart a stopped service by using the ServiceController.Start() method.
4
4033
by: larry | last post by:
Hi, I would like to use window search to search a word in C# CS file which create by visual studio. But I can never get that word in the cs file. for example, I used a name space: "myTopNameSpace.NameSpaceOne" window search window: file name: *.* A word: "myTopNameSpace"
5
1471
by: somersbar | last post by:
i hav a project in visual basic.net which uses asp.net web forms to access a microsoft access database. i had fierce trouble getting it to access the database but fixed it by accident. basically i deleted the database from under 'data connections' in the 'server explorer window' on the screen and now it works fine. i was getting errors probably because of connection strings and access privileges to my database but now its fine. can anyone...
1
2228
by: UJ | last post by:
Do anybody have any code to grab the Windows XP CD Key ? TIA - Jeff.
3
1409
by: tshad | last post by:
My status window is showing in a small XP window I am opening up even though I have "Status=no" function OpenLogoPreviewWindow() { window.open('logoDisplay.htm','myWindow','menubar=no,toolbar=no,directories=no,resizable=no,scrollbars=no,location=no,status=no');}In the script, I have to add about 50 to handle the size of the statuswindows:function entry(){ document.LogoDisplay.src = "..\\..\\uploads\\"...
1
5581
by: chitra g | last post by:
Hi, I tried all the options below but did not work. Your suggestions please.
0
9825
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9671
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10596
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9382
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4021
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.