Click here to Skip to main content
15,893,814 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# webcam video recording Please Help me! Pin
OriginalGriff28-Apr-14 8:05
mveOriginalGriff28-Apr-14 8:05 
Question"Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
Member 1059173628-Apr-14 7:22
Member 1059173628-Apr-14 7:22 
AnswerRe: "Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
OriginalGriff28-Apr-14 8:02
mveOriginalGriff28-Apr-14 8:02 
GeneralRe: "Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
Member 1059173628-Apr-14 9:11
Member 1059173628-Apr-14 9:11 
AnswerRe: "Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
OriginalGriff28-Apr-14 9:28
mveOriginalGriff28-Apr-14 9:28 
GeneralRe: "Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
Member 1059173628-Apr-14 20:46
Member 1059173628-Apr-14 20:46 
GeneralRe: "Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
OriginalGriff28-Apr-14 21:12
mveOriginalGriff28-Apr-14 21:12 
GeneralRe: "Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
Dave Kreskowiak28-Apr-14 9:31
mveDave Kreskowiak28-Apr-14 9:31 
GeneralRe: "Attempted to divide by zero" Exception occuring in "Audio Steganography" in c# Pin
Pete O'Hanlon29-Apr-14 0:29
mvePete O'Hanlon29-Apr-14 0:29 
QuestionHow can I dictate the position of the run prompt? Pin
turbosupramk328-Apr-14 3:38
turbosupramk328-Apr-14 3:38 
AnswerRe: How can I dictate the position of the run prompt? Pin
Dave Kreskowiak28-Apr-14 9:28
mveDave Kreskowiak28-Apr-14 9:28 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk328-Apr-14 9:44
turbosupramk328-Apr-14 9:44 
GeneralRe: How can I dictate the position of the run prompt? Pin
Dave Kreskowiak28-Apr-14 10:26
mveDave Kreskowiak28-Apr-14 10:26 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk328-Apr-14 11:02
turbosupramk328-Apr-14 11:02 
GeneralRe: How can I dictate the position of the run prompt? Pin
Dave Kreskowiak28-Apr-14 13:43
mveDave Kreskowiak28-Apr-14 13:43 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk328-Apr-14 15:26
turbosupramk328-Apr-14 15:26 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk329-Apr-14 2:35
turbosupramk329-Apr-14 2:35 
GeneralRe: How can I dictate the position of the run prompt? Pin
Alan N29-Apr-14 6:14
Alan N29-Apr-14 6:14 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk329-Apr-14 9:14
turbosupramk329-Apr-14 9:14 
GeneralRe: How can I dictate the position of the run prompt? Pin
Dave Kreskowiak29-Apr-14 10:36
mveDave Kreskowiak29-Apr-14 10:36 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk330-Apr-14 6:02
turbosupramk330-Apr-14 6:02 
GeneralRe: How can I dictate the position of the run prompt? Pin
Dave Kreskowiak30-Apr-14 8:16
mveDave Kreskowiak30-Apr-14 8:16 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk330-Apr-14 8:49
turbosupramk330-Apr-14 8:49 
GeneralRe: How can I dictate the position of the run prompt? Pin
Alan N29-Apr-14 11:25
Alan N29-Apr-14 11:25 
OK,
The only public method in the class is FindWindows. It calls the native EnumWindows method which enumerates all top level window handles and for every window handle found a callback method is invoked. The method, which has the signature bool EnumWindowsProc(IntPtr hwnd, IntPtr state), is SelectWindowsByPID.

So some code that starts the process you are interested in and then enumerates the window handles,
C#
Process p = Process.Start(@"c:\Windows\System32\rundll32.exe",  "shell32.dll,#61");
ProcessWindowFinder finder = new ProcessWindowFinder();
finder.FindWindows(p);

On my system 267 window handles were found and SelectWindowsByPID was invoked once for each of those handles. The filtering by process ID showed that only 3 were associated with the rundll32 process.

To determine which of those 3 handles identifies the "Run" window use the native GetWindowText function. There is an example c# method on pinvoke.net http://www.pinvoke.net/default.aspx/user32/GetWindowText.html[^]. For testing insert your code inside the if block where I inserted the comment // Do something here.

Alan.
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk330-Apr-14 6:11
turbosupramk330-Apr-14 6:11 

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.