Re: [OT] Swap RGB

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ricardo Forno wrote:
> 
> 
> Hi Pete.
> I went to the description and, unless I don't understand exactly what it does,
> this is not the thing I want.
> According to what I understood, the SetSysColors routine is applied only to
> a single window.
No, it is system side, but see below.
> If you are browsing the Net, this windows gets changed rapidly, and
> consequently
> the routine's effect dissapears.
> Moreover, I'd like to execute a program *before* connecting to Internet, such
> that its effects last
> until the program is executed once more.
> Maybe I am in error, but I don't think SetSysColors can do that.
> Do you remember a joke program that in old times changed the screen upside
> down,
> or the phrases backward, until some action was taken? Well, what I want is
> something similar, but in relation to colors.
> But it seems no one knows about it, and probably it was never written.
> Thanks again, and best regards.

Don't get your hopes up too high, but I translated an m$ example to Eu. It does
a good job on Explorer, the trouble is that most programs such as Opera (and
Edita) do not display things using system colours very often, so the effect is
much more limited. Anyway, worth a spin just for a laugh:

include dll.e
include machine.e
include get.e
constant user32=open_dll("user32.dll"),
	 xGetSysColor=define_c_func(user32,"GetSysColor",{C_INT},C_INT),
xSetSysColor=define_c_func(user32,"SetSysColors",{C_INT,C_POINTER,C_POINTER},C_INT),
	 pDspElements=allocate(4*19),
	 pRGBValues=allocate(4*19)

sequence Csave
object void

    Csave=repeat(0,19)
    for i=0 to 18 do
	Csave[i+1]=c_func(xGetSysColor,{i})
    end for
    for i=0 to 18 do
	poke4(pDspElements+i*4,i)
	poke4(pRGBValues+i*4,rand(#FFFFFF))
    end for
    void = c_func(xSetSysColor,{19,pDspElements,pRGBValues})
    puts(1,"press any key to reset")
    if wait_key() then end if
    poke4(pRGBValues,Csave)
    void = c_func(xSetSysColor,{19,pDspElements,pRGBValues})


Regards,
Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu