Can someone help me to larn how to read and write to the registry(win32app) and please dont send me to planet source code.
Printable View
Can someone help me to larn how to read and write to the registry(win32app) and please dont send me to planet source code.
Is it all right if I send you to MSDN? :D
as long as its a good link and it really hels me with like a example unless you send me and give me aa example lol thanks :)
http://msdn.microsoft.com/library
Head for the "Registry" section :)
WHERE AT? we all know MSDN is huge! :)
Search tools are useful. Come on, you have to look for things at least once ;)
i do search what do you think i have been doing all day? If i search for regisrty i get like 1k in results(1000) and a thousand too much cuz it dont even help most of the time
and didnt i ask for help from you not from msdn and you didnt even help if ur gonna tell me to search i could have did that on my own oops i did. So why are you posting here if you have no direct help. your basically sending me from point a to b to find c why>?
Because eventually you start to get good at it, that's why. Yes, I know, I'm a complete bastard, but I learnt the hard way and I'm unlikely to forget in a hurry.
For example, I haven't developed on Windows for about a year now, and I can still remember how to write Windows programs *shrug*
But anyway, I think I've had enough fun for now, so here's something more useful:
http://msdn.microsoft.com/library/de..._reference.asp
soryr i didnt mean it that way. And thanks for the link ill checmk it out now. Oh yah happy thanks giving! (sorry and thanks for giving me help)
It's ok, you can't offend me whether you mean it or not ;) Sometimes you have to give people a little shove or it doesn't go in :D
No problems, and if I was American I might appreciate Thanksgiving more ;) Enjoy it yourself! :)
thx 1 more thign i got:
RegCreateKeyEx (HKEY_LOCAL_MACHINE ,"Software\Red",0,"test",REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,0,Res1, Res2);
what type is res1 and res2 (i know hkey but how do i define it ) i tried long Res1, and HKEY Res1 what is it?
also i downloaded the api guide (vb) can i use that to gert a understanding of how some code is proccessed like types and strings go here and there
Look.
All datatypes and user-defined types in Windows are based on
common datatypes - char short long int.... etc.
if you find DWORD, HRESULT in caps it means they are either a typedef or a #define. So - anything in caps is something MS defined, and it is made of understandable pieces.
How do you find out what these mean? Ie., what is HRESULT?
Use the advanced search feature in Windows Explorer. Search in header files for 'typedef' or '#define' and 'HRESULT'
Plus, MSDN comes with MSVC++ - you can just open up help and type in HRESULT in the Index - you get
And you know that a handle is a long.Quote:
HRESULT
An opaque result handle defined to be zero for a successful return from a function and nonzero if error or status information is returned. To convert an HRESULT into the more detailed SCODE, applications call GetScode(). See also SCODE.
you listen ima newbi top vc++ and lost my msdn cd's and how the blank am i ganna know what to blank searh for
For future reference, here's the best link if you search for API in MSDN.
http://msdn.microsoft.com/library/de...y_category.asp
Easy now, you don't want to annoy Jim since he's been doing this longer than I've been alive :pQuote:
Originally posted by JasonLpz
you listen ima newbi top vc++ and lost my msdn cd's and how the blank am i ganna know what to blank searh for
Let's see. hKey is the parent key for your new key. lpSubKey is the name of your new key. Reserved must be 0. lpClass should be NULL. dwOptions can be simply set to 0.Code:LONG RegCreateKeyEx(
HKEY hKey, // handle to open key
LPCTSTR lpSubKey, // subkey name
DWORD Reserved, // reserved
LPTSTR lpClass, // class string
DWORD dwOptions, // special options
REGSAM samDesired, // desired security access
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // inheritance
PHKEY phkResult, // key handle
LPDWORD lpdwDisposition // disposition value buffer
samDesired is of type REGSAM, which is just another typedef for unsigned long. Usually set to KEY_ALL_ACCESS.
lpSecurityAttributes is a pointer to a SECURITY_ATTRIBUTES struct. You can pass NULL.
phkResult is a pointer to a HKEY, which gets filled with a handle to the newly created key. Pass the address of a stack variable:
HKEY res;
RegCreateKeyEx(..., &res, ...);
lpdwDisposition finally is a pointer to a DWORD, which gets filled with information about the result of the operation. It will tell you if the key already existed and only was opened, or if it was really created. If you don't care, pass NULL. Else pass the address of a DWORD just as with phkResult.
In terms of losing your CD's - make an effort to buy new ones - $10 for MSDN platform SDK, for example. And, getting mad at me because I don't know that you lost yours - it reminds me of students and homework - as in 'my roommate took my backpack'.
The only person you're messing up is yourself. Not us here.
I don't use MSVC much but - without instant references - the compiler product becomes a whole lot less useful. There are 5400+ api's, for example. I don't think anyone could correctly remember all of them. In other words, you REALLY need desktop references. Desktop as in PC desktop.