Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do I indicate end-of-stream when sending data via a pipe? Pin
PIEBALDconsult13-May-09 15:30
mvePIEBALDconsult13-May-09 15:30 
GeneralRe: How do I indicate end-of-stream when sending data via a pipe? Pin
arnold_w13-May-09 21:04
arnold_w13-May-09 21:04 
Questioncrystal report Pin
nagendra.vk13-May-09 3:43
nagendra.vk13-May-09 3:43 
AnswerRe: crystal report Pin
Nagy Vilmos13-May-09 3:51
professionalNagy Vilmos13-May-09 3:51 
AnswerRe: crystal report Pin
Dave Kreskowiak13-May-09 5:34
mveDave Kreskowiak13-May-09 5:34 
QuestionVideo Playback Pin
Evgeni5713-May-09 3:29
Evgeni5713-May-09 3:29 
AnswerRe: Video Playback Pin
Christian Graus13-May-09 5:20
protectorChristian Graus13-May-09 5:20 
QuestionSendInput Parameter error Pin
IceWater4213-May-09 3:03
IceWater4213-May-09 3:03 
Billy reports error 87, "The parameter is incorrect" on my x64 machine.

public struct INPUT
{
public int type;
public MOUSEINPUT mi;
}
public struct MOUSEINPUT
{
public int dx;
public int dy;
public int mouseData;
public int dwFlags;
public int time;
public int dwExtraInfo;
} [DllImport("User32.dll", SetLastError = true)]
public static extern int SendInput(int nInputs, ref INPUT pInputs, int cbSize);
...
input.type = INPUT_MOUSE;
input.mi.dx = 0;
input.mi.dy = 0;
input.mi.mouseData = 0;
input.mi.time = 0;
input.mi.dwFlags = 0;
input.mi.dwExtraInfo = 0;

SetForegroundWindow(hWndC);

RECT textWindowRect = new RECT();
GetWindowRect(hWndC.ToInt32(), ref textWindowRect);
// Put Cursor on 1st line of the text box
input.mi.dwFlags = (MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE);
input.mi.dx = textWindowRect.right - 30;
input.mi.dy = textWindowRect.top + 2;
resSendInput = SendInput(1, ref input, Marshal.SizeOf(input));
if (resSendInput == 0)
{
string errorMessage = new Win32Exception(Marshal.GetLastWin32Error()).Message;
MessageBox.Show(errorMessage);
}

The error occurs on this SendInput. I know that the dx and dy calculations are correct cuz the following statement works if i substitute it for the SendInput:

SetCursorPos(textWindowRect.right - 30, textWindowRect.top + 2);

This is mi at time of error message:
mi {MyBuddy.Form1.MOUSEINPUT} MyBuddy.Form1.MOUSEINPUT
dwExtraInfo 0 int
dwFlags 32770 int
dx 251 int
dy 526 int
mouseData 0 int
time 0 int


The whole idea of running 32-bit code on a 64-bit machine boggles my mind. After messing with this for about 20 hours ... I'm getting a headache!
AnswerRe: SendInput Parameter error Pin
Luc Pattyn13-May-09 3:34
sitebuilderLuc Pattyn13-May-09 3:34 
GeneralRe: SendInput Parameter error Pin
IceWater4218-May-09 19:15
IceWater4218-May-09 19:15 
QuestionThread Sleep issue with C# component Pin
rashmin patel13-May-09 2:38
rashmin patel13-May-09 2:38 
AnswerRe: Thread Sleep issue with C# component Pin
Ennis Ray Lynch, Jr.13-May-09 2:48
Ennis Ray Lynch, Jr.13-May-09 2:48 
QuestionForm designer performance Pin
Dan Neely13-May-09 2:35
Dan Neely13-May-09 2:35 
AnswerRe: Form designer performance Pin
Ennis Ray Lynch, Jr.13-May-09 3:08
Ennis Ray Lynch, Jr.13-May-09 3:08 
AnswerRe: Form designer performance Pin
Luc Pattyn13-May-09 3:11
sitebuilderLuc Pattyn13-May-09 3:11 
GeneralRe: Form designer performance Pin
Dan Neely13-May-09 4:17
Dan Neely13-May-09 4:17 
GeneralRe: Form designer performance Pin
Luc Pattyn13-May-09 4:32
sitebuilderLuc Pattyn13-May-09 4:32 
QuestionEnter Key press is not working in ComboBox Pin
rajender303513-May-09 2:27
rajender303513-May-09 2:27 
AnswerRe: Enter Key press is not working in ComboBox Pin
Luc Pattyn13-May-09 2:35
sitebuilderLuc Pattyn13-May-09 2:35 
AnswerRe: Enter Key press is not working in ComboBox Pin
Member 103390713-May-09 7:14
Member 103390713-May-09 7:14 
QuestionHow can a console application return data to the calling application? Pin
arnold_w13-May-09 2:09
arnold_w13-May-09 2:09 
AnswerRe: How can a console application return data to the calling application? Pin
Henry Minute13-May-09 2:29
Henry Minute13-May-09 2:29 
AnswerRe: How can a console application return data to the calling application? Pin
Luc Pattyn13-May-09 2:34
sitebuilderLuc Pattyn13-May-09 2:34 
NewsRe: How can a console application return data to the calling application? Pin
arnold_w13-May-09 3:35
arnold_w13-May-09 3:35 
GeneralRe: How can a console application return data to the calling application? Pin
Luc Pattyn13-May-09 3:44
sitebuilderLuc Pattyn13-May-09 3:44 

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.