Click here to Skip to main content
15,908,274 members
Home / Discussions / C#
   

C#

 
QuestionGetProcessesByName - other way? Pin
FreewareFire27-Nov-05 12:49
FreewareFire27-Nov-05 12:49 
AnswerRe: GetProcessesByName - other way? Pin
S. Senthil Kumar27-Nov-05 19:56
S. Senthil Kumar27-Nov-05 19:56 
GeneralRe: GetProcessesByName - other way? Pin
FreewareFire28-Nov-05 0:38
FreewareFire28-Nov-05 0:38 
QuestionToolbar Color Pin
fredspv27-Nov-05 12:07
fredspv27-Nov-05 12:07 
QuestionC# DisplayComposeForm for Smartphone Pin
bklynjava127-Nov-05 11:10
bklynjava127-Nov-05 11:10 
QuestionIndexOutOfRangeException with SgmlReader Pin
Liunardu27-Nov-05 8:18
Liunardu27-Nov-05 8:18 
Questioneh, 1 last mouse question... Pin
Sam 200627-Nov-05 8:12
Sam 200627-Nov-05 8:12 
AnswerRe: eh, 1 last mouse question... Pin
Curtis Schlak.27-Nov-05 8:43
Curtis Schlak.27-Nov-05 8:43 
Sam,

You might want to read "Test Run: Low-Level UI Test Automation," specifically the section "Manipulating the App and Checking App State." by James McCaffrey.

In that section, he has the following code:
public void ClickOn()
{
  uint WM_LBUTTONDOWN = 0x0201;
  uint WM_LBUTTONUP   = 0x0202;
  PostMessage( this.ptrToWindow, WM_LBUTTONDOWN, 0, 0 ); // button down
  PostMessage( this.ptrToWindow, WM_LBUTTONUP, 0, 0 ); // button up
}
where this.ptrToWindow is an IntPtr that stores the target window's handle.

He then explains about the two last parameters to the PostMessage call.
When processing the WM_LBUTTONDOWN and WM_LBUTTONUP messages, the wParam value indicates whether various key-state masks like MK_SHIFT are down. The lParam value represents the x and y coordinates of the cursor relative to the upper-left corner of the window. Here I pass 0,0 to WM_LBUTTONDOWN and WM_LBUTTONUP in order to simulate mouse clicks on the upper-left corner of the target window without any keys pressed.
Hope that helps.

"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
GeneralRe: eh, 1 last mouse question... Pin
Sam 200627-Nov-05 12:40
Sam 200627-Nov-05 12:40 
GeneralRe: eh, 1 last mouse question... Pin
Curtis Schlak.27-Nov-05 13:58
Curtis Schlak.27-Nov-05 13:58 
Questionfrom DataSet to GridView Pin
tray_gator27-Nov-05 4:53
tray_gator27-Nov-05 4:53 
AnswerRe: from DataSet to GridView Pin
Curtis Schlak.27-Nov-05 5:07
Curtis Schlak.27-Nov-05 5:07 
GeneralRe: from DataSet to GridView Pin
tray_gator27-Nov-05 6:10
tray_gator27-Nov-05 6:10 
GeneralRe: from DataSet to GridView Pin
Curtis Schlak.27-Nov-05 7:38
Curtis Schlak.27-Nov-05 7:38 
GeneralRe: from DataSet to GridView Pin
tray_gator27-Nov-05 9:12
tray_gator27-Nov-05 9:12 
GeneralRe: from DataSet to GridView Pin
Curtis Schlak.27-Nov-05 9:23
Curtis Schlak.27-Nov-05 9:23 
Questionanother mouse question (events) Pin
Sam 200627-Nov-05 2:44
Sam 200627-Nov-05 2:44 
AnswerRe: another mouse question (events) Pin
Stanciu Vlad27-Nov-05 5:34
Stanciu Vlad27-Nov-05 5:34 
AnswerRe: another mouse question (events) Pin
Curtis Schlak.27-Nov-05 6:04
Curtis Schlak.27-Nov-05 6:04 
GeneralRe: another mouse question (events) Pin
Sam 200627-Nov-05 7:42
Sam 200627-Nov-05 7:42 
GeneralRe: another mouse question (events) Pin
Curtis Schlak.27-Nov-05 8:01
Curtis Schlak.27-Nov-05 8:01 
AnswerRe: another mouse question (events) Pin
User 665827-Nov-05 6:08
User 665827-Nov-05 6:08 
Questionretrieving from array list. Pin
sadek_a_27-Nov-05 1:08
sadek_a_27-Nov-05 1:08 
AnswerRe: retrieving from array list. Pin
Curtis Schlak.27-Nov-05 2:45
Curtis Schlak.27-Nov-05 2:45 
GeneralRe: retrieving from array list. Pin
sadek_a_27-Nov-05 3:19
sadek_a_27-Nov-05 3:19 

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.