brightness

  • Thread starter Thread starter Shaul
  • Start date Start date
S

Shaul

Hi
I have a little background brightness problem.
I would like to change it (battery mode) to half with C#.
is it possible?

many thanks

Shaul
 
thanks the thread is very usefull but I didnt secceed to change the
background brightness with it.
what parameter I need to change?

code from thread:
....
const int CONTRASTCOMMAND = 6149;

const int CONTRAST_CMD_GET = 0; // Parm=Ignored, Out=Current setting

const int CONTRAST_CMD_SET = 1; // Parm=NewSet, Out=Resulting setting

const int CONTRAST_CMD_INCREASE = 2; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DECREASE = 3; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DEFAULT = 4; // Parm=Ignored, Out=Resulting setting

const int CONTRAST_CMD_MAX = 5; // Parm=Ignored, Out=Max value

....

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, int[]

InData, int cbOutData, IntPtr OutData);

[DllImport("coredll")]

private static extern IntPtr GetDC(IntPtr hwnd);

....

(the button function:)

....

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];

vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 0;

ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

....
 
Hello,

Many thanks to Sergey Bogdanov, the next code is working for me :

[DllImport("coredll")]

extern static IntPtr GetDC(IntPtr hWnd);

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static int ExtEscape(IntPtr hDC, int Esc, int cbInData, int []

InData, int cbOutData, IntPtr OutData);







private void btnMinus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DECREASE;

vpm[1] = 3; // decrease with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}





private void btnDefault_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DEFAULT;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnPlus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_INCREASE;

vpm[1] = 3; // increase with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnSet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 75; // value to set between 0 and 256

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}



private void btnGet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_GET;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

textBox1.Text = r.ToString(); //does r returns Zero? If so then the device
capabilitie of
//this function was not implemented by an OEM.
ReleaseDC(IntPtr.Zero, hDC);


}



Kind regards,

Peter








Shaul said:
thanks the thread is very usefull but I didnt secceed to change the
background brightness with it.
what parameter I need to change?

code from thread:
...
const int CONTRASTCOMMAND = 6149;

const int CONTRAST_CMD_GET = 0; // Parm=Ignored, Out=Current setting

const int CONTRAST_CMD_SET = 1; // Parm=NewSet, Out=Resulting setting

const int CONTRAST_CMD_INCREASE = 2; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DECREASE = 3; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DEFAULT = 4; // Parm=Ignored, Out=Resulting setting

const int CONTRAST_CMD_MAX = 5; // Parm=Ignored, Out=Max value

...

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, int[]

InData, int cbOutData, IntPtr OutData);

[DllImport("coredll")]

private static extern IntPtr GetDC(IntPtr hwnd);

...

(the button function:)

...

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];

vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 0;

ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

...



Sergey Bogdanov said:
check this thread - maybe it will be usefull:
http://groups-beta.google.com/group.../14ad779d07b57509/a38fd1451760c4b4?q=ExtEscap
e&_done=%2Fgroup%2Fmicrosoft.public.dotnet.framework.compactframework%2Fsear
ch%3Fgroup%3Dmicrosoft.public.dotnet.framework.compactframework%26q%3DExtEsc
ape%26qt_g%3D1%26&_doneTitle=Back+to+Search&&d#a38fd1451760c4b4
Best regards,
Sergey Bogdanov
 
Hi and Thanks
is it works for you on ppc 2003 and change the background brightness ?
(make it darker and lighter)?


Peter said:
Hello,

Many thanks to Sergey Bogdanov, the next code is working for me :

[DllImport("coredll")]

extern static IntPtr GetDC(IntPtr hWnd);

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static int ExtEscape(IntPtr hDC, int Esc, int cbInData, int []

InData, int cbOutData, IntPtr OutData);







private void btnMinus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DECREASE;

vpm[1] = 3; // decrease with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}





private void btnDefault_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DEFAULT;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnPlus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_INCREASE;

vpm[1] = 3; // increase with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnSet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 75; // value to set between 0 and 256

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}



private void btnGet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_GET;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

textBox1.Text = r.ToString(); //does r returns Zero? If so then the device
capabilitie of
//this function was not implemented by an OEM.
ReleaseDC(IntPtr.Zero, hDC);


}



Kind regards,

Peter








Shaul said:
thanks the thread is very usefull but I didnt secceed to change the
background brightness with it.
what parameter I need to change?

code from thread:
...
const int CONTRASTCOMMAND = 6149;

const int CONTRAST_CMD_GET = 0; // Parm=Ignored, Out=Current setting

const int CONTRAST_CMD_SET = 1; // Parm=NewSet, Out=Resulting setting

const int CONTRAST_CMD_INCREASE = 2; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DECREASE = 3; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DEFAULT = 4; // Parm=Ignored, Out=Resulting setting

const int CONTRAST_CMD_MAX = 5; // Parm=Ignored, Out=Max value

...

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, int[]

InData, int cbOutData, IntPtr OutData);

[DllImport("coredll")]

private static extern IntPtr GetDC(IntPtr hwnd);

...

(the button function:)

...

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];

vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 0;

ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

...



Sergey Bogdanov said:
check this thread - maybe it will be usefull:
http://groups-beta.google.com/group...ic.dotnet.framework.compactframework&q=ExtEsc
ape%26qt_g%3D1%26&_doneTitle=Back+to+Search&&d#a38fd1451760c4b4
 
Hello Shaul,

I'm running a WINCE 4.2 Device not a PocketPC, I'v tried the same code on a
Quetek 2020 MDA, but nothing happend - I guess that it's not compatible.
Maybe you have to look at BackLight on the PocketPC.

on this topic try :
http://groups-beta.google.com/group...soft.public.dotnet.framework.compactframework

http://www.google.nl/groups?hl=nl&l...otnet.framework.compactframework*&btnG=Zoeken


Maybe you have to change the registry ?
If you find a solution how to get it working, I'd like to hear it from you.

Kind regards

Peter.




Shaul said:
Hi and Thanks
is it works for you on ppc 2003 and change the background brightness ?
(make it darker and lighter)?


Peter said:
Hello,

Many thanks to Sergey Bogdanov, the next code is working for me :

[DllImport("coredll")]

extern static IntPtr GetDC(IntPtr hWnd);

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static int ExtEscape(IntPtr hDC, int Esc, int cbInData, int []

InData, int cbOutData, IntPtr OutData);







private void btnMinus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DECREASE;

vpm[1] = 3; // decrease with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}





private void btnDefault_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DEFAULT;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnPlus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_INCREASE;

vpm[1] = 3; // increase with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnSet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 75; // value to set between 0 and 256

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}



private void btnGet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_GET;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

textBox1.Text = r.ToString(); //does r returns Zero? If so then the device
capabilitie of
//this function was not implemented by an OEM.
ReleaseDC(IntPtr.Zero, hDC);


}



Kind regards,

Peter








Shaul said:
thanks the thread is very usefull but I didnt secceed to change the
background brightness with it.
what parameter I need to change?

code from thread:
...
const int CONTRASTCOMMAND = 6149;

const int CONTRAST_CMD_GET = 0; // Parm=Ignored, Out=Current setting

const int CONTRAST_CMD_SET = 1; // Parm=NewSet, Out=Resulting setting

const int CONTRAST_CMD_INCREASE = 2; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DECREASE = 3; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DEFAULT = 4; // Parm=Ignored, Out=Resulting setting

const int CONTRAST_CMD_MAX = 5; // Parm=Ignored, Out=Max value

...

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, int[]

InData, int cbOutData, IntPtr OutData);

[DllImport("coredll")]

private static extern IntPtr GetDC(IntPtr hwnd);

...

(the button function:)

...

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];

vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 0;

ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

...



check this thread - maybe it will be usefull:
http://groups-beta.google.com/group...ic.dotnet.framework.compactframework&q=ExtEsc
 
Thank you
I will keep you updated if I will find the solution.

regards

Shaul


Peter said:
Hello Shaul,

I'm running a WINCE 4.2 Device not a PocketPC, I'v tried the same code on a
Quetek 2020 MDA, but nothing happend - I guess that it's not compatible.
Maybe you have to look at BackLight on the PocketPC.

on this topic try :
http://groups-beta.google.com/group...otnet.framework.compactframework*&btnG=Zoeken


Maybe you have to change the registry ?
If you find a solution how to get it working, I'd like to hear it from you.

Kind regards

Peter.




Shaul said:
Hi and Thanks
is it works for you on ppc 2003 and change the background brightness ?
(make it darker and lighter)?


Peter said:
Hello,

Many thanks to Sergey Bogdanov, the next code is working for me :

[DllImport("coredll")]

extern static IntPtr GetDC(IntPtr hWnd);

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static int ExtEscape(IntPtr hDC, int Esc, int cbInData, int []

InData, int cbOutData, IntPtr OutData);







private void btnMinus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DECREASE;

vpm[1] = 3; // decrease with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}





private void btnDefault_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DEFAULT;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnPlus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_INCREASE;

vpm[1] = 3; // increase with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnSet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 75; // value to set between 0 and 256

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}



private void btnGet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_GET;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

textBox1.Text = r.ToString(); //does r returns Zero? If so then the device
capabilitie of
//this function was not implemented by an OEM.
ReleaseDC(IntPtr.Zero, hDC);


}



Kind regards,

Peter








"Shaul" <[email protected]> schreef in bericht
thanks the thread is very usefull but I didnt secceed to change the
background brightness with it.
what parameter I need to change?

code from thread:
...
const int CONTRASTCOMMAND = 6149;

const int CONTRAST_CMD_GET = 0; // Parm=Ignored, Out=Current setting

const int CONTRAST_CMD_SET = 1; // Parm=NewSet, Out=Resulting setting

const int CONTRAST_CMD_INCREASE = 2; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DECREASE = 3; // Parm=Amount, Out=Resulting setting

const int CONTRAST_CMD_DEFAULT = 4; // Parm=Ignored, Out=Resulting setting

const int CONTRAST_CMD_MAX = 5; // Parm=Ignored, Out=Max value

...

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, int[]

InData, int cbOutData, IntPtr OutData);

[DllImport("coredll")]

private static extern IntPtr GetDC(IntPtr hwnd);

...

(the button function:)

...

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];

vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 0;

ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

...



check this thread - maybe it will be usefull:
http://groups-beta.google.com/group...ic.dotnet.framework.compactframework&q=ExtEsc
 
Just be aware that there may not be a solution. Is there a way to change
the display brightness from the Control Panel or an application provided by
the device OEM? If not, there's a very good chance that there is no API for
doing that.

Paul T.

Shaul said:
Thank you
I will keep you updated if I will find the solution.

regards

Shaul


Peter said:
Hello Shaul,

I'm running a WINCE 4.2 Device not a PocketPC, I'v tried the same code on a
Quetek 2020 MDA, but nothing happend - I guess that it's not compatible.
Maybe you have to look at BackLight on the PocketPC.

on this topic try :
http://groups-beta.google.com/group...otnet.framework.compactframework*&btnG=Zoeken


Maybe you have to change the registry ?
If you find a solution how to get it working, I'd like to hear it from you.

Kind regards

Peter.




Shaul said:
Hi and Thanks
is it works for you on ppc 2003 and change the background brightness ?
(make it darker and lighter)?


Hello,

Many thanks to Sergey Bogdanov, the next code is working for me :

[DllImport("coredll")]

extern static IntPtr GetDC(IntPtr hWnd);

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static int ExtEscape(IntPtr hDC, int Esc, int cbInData, int []

InData, int cbOutData, IntPtr OutData);







private void btnMinus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DECREASE;

vpm[1] = 3; // decrease with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}





private void btnDefault_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_DEFAULT;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnPlus_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_INCREASE;

vpm[1] = 3; // increase with this value

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);


}

private void btnSet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 75; // value to set between 0 and 256

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

}



private void btnGet_Click(object sender, System.EventArgs e)

{

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];


vpm[0] = CONTRAST_CMD_GET;

vpm[1] = 0;

int r = ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

textBox1.Text = r.ToString(); //does r returns Zero? If so then the
device
capabilitie of
//this function was not implemented by an OEM.
ReleaseDC(IntPtr.Zero, hDC);


}



Kind regards,

Peter








"Shaul" <[email protected]> schreef in bericht
thanks the thread is very usefull but I didnt secceed to change the
background brightness with it.
what parameter I need to change?

code from thread:
...
const int CONTRASTCOMMAND = 6149;

const int CONTRAST_CMD_GET = 0; // Parm=Ignored, Out=Current
setting

const int CONTRAST_CMD_SET = 1; // Parm=NewSet, Out=Resulting setting

const int CONTRAST_CMD_INCREASE = 2; // Parm=Amount, Out=Resulting
setting

const int CONTRAST_CMD_DECREASE = 3; // Parm=Amount, Out=Resulting
setting

const int CONTRAST_CMD_DEFAULT = 4; // Parm=Ignored, Out=Resulting
setting

const int CONTRAST_CMD_MAX = 5; // Parm=Ignored, Out=Max value

...

[DllImport("coredll")]

extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("coredll")]

extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, int[]

InData, int cbOutData, IntPtr OutData);

[DllImport("coredll")]

private static extern IntPtr GetDC(IntPtr hwnd);

...

(the button function:)

...

IntPtr hDC = GetDC(IntPtr.Zero);

int[] vpm = new int[2];

vpm[0] = CONTRAST_CMD_SET;

vpm[1] = 0;

ExtEscape(hDC, CONTRASTCOMMAND, 8, vpm, 0, IntPtr.Zero);

ReleaseDC(IntPtr.Zero, hDC);

...



check this thread - maybe it will be usefull:
http://groups-beta.google.com/group...ic.dotnet.framework.compactframework&q=ExtEsc
ape%26qt_g%3D1%26&_doneTitle=Back+to+Search&&d#a38fd1451760c4b4

Best regards,
Sergey Bogdanov


Shaul wrote:
Hi
I have a little background brightness problem.
I would like to change it (battery mode) to half with C#.
is it possible?

many thanks

Shaul
 
Back
Top