Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can it really be true? Pin
leppie2-Jul-03 7:09
leppie2-Jul-03 7:09 
GeneralRe: Can it really be true? Pin
Marc Clifton2-Jul-03 7:23
mvaMarc Clifton2-Jul-03 7:23 
GeneralRe: Can it really be true? Pin
Nick Parker2-Jul-03 7:31
protectorNick Parker2-Jul-03 7:31 
GeneralRe: Can it really be true? Pin
leppie2-Jul-03 7:33
leppie2-Jul-03 7:33 
GeneralRe: Can it really be true? Pin
J. Dunlap2-Jul-03 9:08
J. Dunlap2-Jul-03 9:08 
GeneralRe: Can it really be true? Pin
James T. Johnson2-Jul-03 23:09
James T. Johnson2-Jul-03 23:09 
GeneralRe: Can it really be true? Pin
Kant3-Jul-03 7:34
Kant3-Jul-03 7:34 
GeneralRe: Can it really be true? Pin
Marc Clifton3-Jul-03 7:37
mvaMarc Clifton3-Jul-03 7:37 
GeneralRe: Can it really be true? Pin
Kant3-Jul-03 8:56
Kant3-Jul-03 8:56 
GeneralFile downloading - web service Pin
jrmcdona2-Jul-03 6:21
jrmcdona2-Jul-03 6:21 
GeneralRe: File downloading - web service Pin
leppie2-Jul-03 7:12
leppie2-Jul-03 7:12 
GeneralRe: File downloading - web service Pin
jrmcdona2-Jul-03 7:19
jrmcdona2-Jul-03 7:19 
GeneralFile I/O fun with binary files Pin
BrewCrew2-Jul-03 5:27
BrewCrew2-Jul-03 5:27 
GeneralRe: File I/O fun with binary files Pin
BrewCrew7-Jul-03 4:02
BrewCrew7-Jul-03 4:02 
GeneralAccessing an inbox in the SMTP service Pin
Johan Danforth2-Jul-03 5:11
Johan Danforth2-Jul-03 5:11 
GeneralRe: Accessing an inbox in the SMTP service Pin
lykac2-Jul-03 12:37
lykac2-Jul-03 12:37 
GeneralRe: Accessing an inbox in the SMTP service Pin
Johan Danforth2-Jul-03 20:33
Johan Danforth2-Jul-03 20:33 
QuestionHow to tell which row of DataGrid has been selected? Pin
Khang Nguyen2-Jul-03 4:38
Khang Nguyen2-Jul-03 4:38 
QuestionHOW to set html element's VALUE. Pin
Asim N.2-Jul-03 0:47
Asim N.2-Jul-03 0:47 
AnswerRe: HOW to set html element's VALUE. Pin
dynamic2-Jul-03 1:46
dynamic2-Jul-03 1:46 
GeneralProblem with DllImport Pin
jtmtv181-Jul-03 19:52
jtmtv181-Jul-03 19:52 
Iam trying to get the pixel of a area in a screen of my program (for collison detection) the API call (GetPixel) seems to work..and it returns a int that i use with Color.FromArgb(int) (i think thats it) anyways when i try to convert the int i get back the color but...it doesnt convert correctly.....the A(alpha) of the color is always 0. Is there something i need to do before i try to convert the int ? Here is the code i use.

<br />
[DllImport("Gdi32.dll")]<br />
private static extern int GetPixel(IntPtr Handler,int x,int y);<br />
[DllImport("user32.dll")]<br />
private static extern IntPtr GetDesktopWindow();<br />
		//<br />
[DllImport("user32.dll")]<br />
private static extern IntPtr GetWindowDC(int Pointer);<br />
[DllImport("user32.dll")]<br />
private static extern IntPtr ReleaseDC(IntPtr hWnd,IntPtr hdc);<br />
<br />
//Use a method Called check pixel (overloads Int X, Int Y)<br />
<br />
int j = CheckPixel(100,100);<br />
int jm =Convert.ToInt32(j);<br />
Color c = Color.FromArgb(jm);<br />
MessageBox.Show(c.ToString());<br />
<br />
//method CheckPixel<br />
<br />
private int CheckPixel(int x,int y)<br />
{<br />
	IntPtr DC = GetWindowDC(GetDesktopWindow().ToInt32());<br />
	int jm = GetPixel(DC,x,y);<br />
	//<br />
	//<br />
	ReleaseDC(GetDesktopWindow(),DC);<br />
	//<br />
	return jm;<br />
}<br />
<br />


Thanks for your time.

Jesse M

The Code Project Is Your Friend...
GeneralRe: Problem with DllImport Pin
Nathan Blomquist2-Jul-03 5:01
Nathan Blomquist2-Jul-03 5:01 
GeneralACCESSING IIS Pin
Asim N.1-Jul-03 19:39
Asim N.1-Jul-03 19:39 
GeneralRe: ACCESSING IIS Pin
Matt Newman2-Jul-03 5:55
Matt Newman2-Jul-03 5:55 
Generaladding image in SubItems of ListView Pin
azusakt1-Jul-03 16:49
azusakt1-Jul-03 16:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.