PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Wanted - Registry code

Hi all, just wondering if someone out there has some funcs, one to write to registry, one to read!, I'm looking at placing a bool value into a key (could be an int).... rather than re-invent the wheel, i'm sure soemone has a simple func (reg_write(key,value) etc.... )

-Thanks, in advance, Brendan
Isn't it already a function in the SDK? Like GetRegValue(location). Not that, I know it isn't, but I don't know what it is. Sorry, I'm not really a programmer, so :(
there are some funcs that are "in depth" I was hoping someone had written some simple funcs, that take into account errors etc... from what I have read it looks like you have to open a key, then write, then close it etc....

no, idea. thats why I was hoping someone had done it, so I could avoid looking at it further....


-Brendan
I posted code to read and write registry values in this very forum, in response to a request made by you. Here's the link:
http://forums.pocketmatrix.com/viewtopic.php?t=6047

Next time I won't bother <sniff>. :?

Cheers,

Ref.
So you did, forgot about that, sorry refractor!

will look-see at code and see if I can do somthing....

ok, looked, am not quite sure about (handle to key query etc, i.e this is my call:

RegSetValue(HKLU,"\\Software\\OzCreations\\Squish3",1,"Music",1);

is there anywhere I can get information on the types etc, all I want to do is read and write a bool... sniff.....

actually what I really need is a sample program that writes a value, then reads it.... anyone?
brendan:as far as I know (not sure thru) Phantom doesn't work on easyce anymore, but I doubt he would mind you if you would add some functions to it and create easyce2.1 .. you would have to ask him thru.

And about sharing code... I have got nothing against it, but your problem is really lame and there's hardly any reinventing the wheel... Microsoft created all the needed functions to open/modify/close registry and they are damn easy to use. You could easily find it out by yourself in half the time you're spending on this forum bugging people.

you're long enought on this forum to know that people help eachother very often... but you ought to put some effort into your programming, too. You don't have a real problem which would take you hours to solve... it can be solved in few mins of reading windows documentation.

PS.this is my point of view and some ppl may think different... I would love to hear your opinion...
Well someone woke up on the wrong side of the bed this morning! :wink:
Geez, I'm sorry, I'll just go and read the doco....

btw in the interest of code sharing:

;-)

these can be handy.... if your not using them to animate a bg there ok (bit slow), not the best method, but there good for just shifting stuff around!

Code:

void move_buffer_down(int x, int y,int size, PIXEL* source)
{
if (size < y)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xs = x * size;
int xy = x * y;
memcpy(screen_temp_p + xs,source, (xy - xs) * 2);
memcpy(screen_temp_p,source + xy - xs, xs * 2);
memcpy(source,screen_temp_p, xy * 2);
delete [] screen_temp_p;
}
}


void move_buffer_up(int x, int y,int size, PIXEL* source)
{
if (size < y)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xs = x * size;
int xy = x * y;
memcpy(screen_temp_p,source + xs, (xy - xs) * 2);
memcpy(screen_temp_p + xy - xs,source, xs * 2);
memcpy(source,screen_temp_p, xy * 2);
delete [] screen_temp_p;
}
}


void move_buffer_left(int x, int y,int size, PIXEL* source)
{
if (size < x)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xy2 = x * y * 2;
memcpy(screen_temp_p,source + size, xy2 - (size * 2));
memcpy(source,screen_temp_p, xy2);
delete [] screen_temp_p;
}
}


void move_buffer_right(int x, int y,int size, PIXEL* source)
{
if (size < x)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xy2 = x * y * 2;
memcpy(screen_temp_p,source - size, xy2 + (size * 2));
memcpy(source,screen_temp_p, xy2);
delete [] screen_temp_p;
}
}


(the PIXEL is just a unsigned short (16 bit graphics)

-B