Click here to Skip to main content
15,904,935 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Pin
Pravin Patil, Mumbai4-Mar-11 0:06
Pravin Patil, Mumbai4-Mar-11 0:06 
QuestionMake window dock/undock to parent window Pin
manchukuo3-Mar-11 8:18
manchukuo3-Mar-11 8:18 
QuestionIs there a way to search through all buttons of a window handle? Pin
turbosupramk33-Mar-11 6:14
turbosupramk33-Mar-11 6:14 
AnswerRe: Is there a way to search through all buttons of a window handle? Pin
SledgeHammer013-Mar-11 6:23
SledgeHammer013-Mar-11 6:23 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
turbosupramk33-Mar-11 6:52
turbosupramk33-Mar-11 6:52 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
SledgeHammer013-Mar-11 8:11
SledgeHammer013-Mar-11 8:11 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
turbosupramk33-Mar-11 8:30
turbosupramk33-Mar-11 8:30 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
SledgeHammer013-Mar-11 9:42
SledgeHammer013-Mar-11 9:42 
Ok, so its a custom control with a class name of "SWT_Window0", so you can't search by class name. As you said, all the buttons have the same class name. It also doesn't seem to store the button text in the standard location, so you can't use that either. Hard coding the window coordinates is not a good idea because if they redesign the screen, your app will break.

It looks like your best bet is to get the button by ID (5841730), to do that, you kind of need to navigate down the tree yourself... what I mean is lets say the window structure is like this:

TopLevelWindow
|- Button you want

so you'd find the TopLevelWindow with FindWindow() (using the classname or window text) and get the HWND and then you'd use that in a call to GetDlgItem() using the 5841730 to get the button.

if the window structure is something like:

TopLevelWindow
|- Some other window
|- Button you want

you'd have to get the "some other window" somehow to use GetDlgItem() or you'd have to recurse through all the windows.

Once you get button HWND, you'd call GetWindowRect() on it to get the screen coordinates and then use the mouse_event with the absolute flag to do the left down and left up. Multi-monitors are handled by the APIs already.
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
turbosupramk33-Mar-11 10:05
turbosupramk33-Mar-11 10:05 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
SledgeHammer013-Mar-11 11:55
SledgeHammer013-Mar-11 11:55 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
turbosupramk33-Mar-11 15:45
turbosupramk33-Mar-11 15:45 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
turbosupramk33-Mar-11 8:55
turbosupramk33-Mar-11 8:55 
AnswerRe: Is there a way to search through all buttons of a window handle? Pin
Jason Vetter3-Mar-11 10:48
Jason Vetter3-Mar-11 10:48 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
turbosupramk33-Mar-11 15:52
turbosupramk33-Mar-11 15:52 
GeneralRe: Is there a way to search through all buttons of a window handle? Pin
turbosupramk34-Mar-11 2:17
turbosupramk34-Mar-11 2:17 
QuestionChrome - search from command line? Pin
Alan Burkhart3-Mar-11 1:33
Alan Burkhart3-Mar-11 1:33 
AnswerRe: Chrome - search from command line? Pin
Luc Pattyn3-Mar-11 2:34
sitebuilderLuc Pattyn3-Mar-11 2:34 
GeneralRe: Chrome - search from command line? Pin
Alan Burkhart3-Mar-11 2:54
Alan Burkhart3-Mar-11 2:54 
GeneralRe: Chrome - search from command line? [modified] Pin
Luc Pattyn3-Mar-11 3:18
sitebuilderLuc Pattyn3-Mar-11 3:18 
GeneralRe: Chrome - search from command line? Pin
musefan3-Mar-11 3:58
musefan3-Mar-11 3:58 
GeneralRe: Chrome - search from command line? Pin
Alan Burkhart3-Mar-11 6:39
Alan Burkhart3-Mar-11 6:39 
GeneralRe: Chrome - search from command line? Pin
Alan Burkhart3-Mar-11 4:13
Alan Burkhart3-Mar-11 4:13 
AnswerRe: Chrome - search from command line? Pin
Luc Pattyn3-Mar-11 4:52
sitebuilderLuc Pattyn3-Mar-11 4:52 
GeneralRe: Chrome - search from command line? Pin
Alan Burkhart3-Mar-11 6:33
Alan Burkhart3-Mar-11 6:33 
GeneralRe: Chrome - search from command line? Pin
Luc Pattyn3-Mar-11 6:42
sitebuilderLuc Pattyn3-Mar-11 6:42 

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.