Click here to Skip to main content
15,879,535 members
Home / Discussions / C#
   

C#

 
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 
I closed and reopened the solution and it worked? Thank you for this, it was such a simple solution, I believe I tried something similar before originally posting but if I remember correctly I would always get a handle of 0 ... it turns out there is a slight delay/lag so before FindWindow will work on a spawned process, as the process has to load. I was not able to figure that out before, but was after you posted your code. Thank you.

@Alan, if you read this, I would still like to learn how your class ties together, and how it could be tweaked. Smile | :)

C#
private void btnTest_Click(object sender, EventArgs e)
        {
            Process p = Process.Start(@"c:\Windows\System32\rundll32.exe", "shell32.dll,#61");

            int timeOutCounter = 0;
            IntPtr runHandle = IntPtr.Zero;
            do
            {
                runHandle = FindWindow((string)null, "Run");
                Thread.Sleep(100);
                timeOutCounter = timeOutCounter + 1;
            } while ((runHandle == IntPtr.Zero) && (timeOutCounter < 30));
          
            if (runHandle != IntPtr.Zero)
            {
                SetWindowPos(runHandle, 0, 800, 800, 425, 235, 0X4 | 0x0040);
            }
              

           
        }

GeneralRe: How can I dictate the position of the run prompt? Pin
Alan N29-Apr-14 11:25
Alan N29-Apr-14 11:25 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk330-Apr-14 6:11
turbosupramk330-Apr-14 6:11 
GeneralRe: How can I dictate the position of the run prompt? Pin
Alan N1-May-14 3:12
Alan N1-May-14 3:12 
GeneralRe: How can I dictate the position of the run prompt? Pin
turbosupramk32-May-14 1:46
turbosupramk32-May-14 1:46 
QuestionImplementing transaction in MVC as Attribute Pin
nitin_ion28-Apr-14 0:12
nitin_ion28-Apr-14 0:12 
AnswerRe: Implementing transaction in MVC as Attribute Pin
Dave Kreskowiak28-Apr-14 3:18
mveDave Kreskowiak28-Apr-14 3:18 
GeneralRe: Implementing transaction in MVC as Attribute Pin
nitin_ion28-Apr-14 17:19
nitin_ion28-Apr-14 17:19 
GeneralRe: Implementing transaction in MVC as Attribute Pin
Dave Kreskowiak28-Apr-14 17:55
mveDave Kreskowiak28-Apr-14 17:55 
QuestionHow to use Multithreading in Async Socket Http request Pin
sbmzhcn27-Apr-14 15:22
sbmzhcn27-Apr-14 15:22 
Questionlooking for a decent book on c# for advanced programmers Pin
Nico Haegens27-Apr-14 1:10
professionalNico Haegens27-Apr-14 1:10 
AnswerRe: looking for a decent book on c# for advanced programmers Pin
Pete O'Hanlon27-Apr-14 1:59
mvePete O'Hanlon27-Apr-14 1:59 
AnswerRe: looking for a decent book on c# for advanced programmers Pin
BillWoodruff27-Apr-14 7:08
professionalBillWoodruff27-Apr-14 7:08 
AnswerRe: looking for a decent book on c# for advanced programmers Pin
jschell27-Apr-14 9:36
jschell27-Apr-14 9:36 
GeneralRe: looking for a decent book on c# for advanced programmers Pin
Ravi Bhavnani28-Apr-14 4:44
professionalRavi Bhavnani28-Apr-14 4:44 
AnswerRe: looking for a decent book on c# for advanced programmers Pin
thatraja27-Apr-14 20:59
professionalthatraja27-Apr-14 20:59 
GeneralRe: looking for a decent book on c# for advanced programmers Pin
Dnyaneshwar@Pune28-Apr-14 0:11
Dnyaneshwar@Pune28-Apr-14 0:11 
GeneralRe: looking for a decent book on c# for advanced programmers Pin
rutja_deore28-Apr-14 0:12
rutja_deore28-Apr-14 0:12 

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.