CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    1

    Minimizing a Loaded Application and More

    Hi, this is my first post on this forum. I am teaching myself VB, so bare with me.

    For my first application, I am writing something called Ignition.exe.

    I intend for this program to autoload at startup. The program will load a bunch of programs I use often, but not every day. This way, I do not have to go through and manually load them all.

    Some programs I want to load on certain parts of the screen.
    Other programs I want to be minimized after loading.

    I've scoured the web and I'm at a dead end, I could use some help.

    You will see I used the Process.Start function to load a program. The gadget is what I want to appear on my desktop, it is fed data by the Core Temp.exe. Hence, after I load Core Temp, I want to minimize it, as it is not necessary on the desktop. So, pretty simple right? How do I minimize it?

    My next question may prove more difficult. If I want the gadget to load on the top left corner of my screen, how would I code that?

    Thanks

    Here is my code so far:
    ----------------------------------
    Module Module1

    Sub Main()



    MsgBox("Would you like to Ignite?", vbYesNo, "Ignition")
    If MsgBoxResult.Yes Then


    Process.Start("K:\Program Files\Core Temp\Core Temp.exe")


    Process.Start("K:\Program Files\Core Temp\CoreTempGadget2.7.gadget")

    Else
    MsgBox("Okay, So Long!", vbOKOnly, "Ignition")

    End If



    End Sub

    End Module

  2. #2
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    Re: Minimizing a Loaded Application and More

    You will see I used the Process.Start function to load a program. The gadget is what I want to appear on my desktop, it is fed data by the Core Temp.exe. Hence, after I load Core Temp, I want to minimize it, as it is not necessary on the desktop. So, pretty simple right? How do I minimize it?



    try the following ! .
    Code:
    Module Module1
    
    Sub Main()
    dim x as string
    
    
    x=MsgBox("Would you like to Ignite?", vbYesNo, "Ignition")
    if x=vbyes then
       Process.Start("K:\Program Files\Core Temp\Core Temp.exe")
       Process.Start("K:\Program Files\Core Temp\CoreTempGadget2.7.gadget")
    
    Else
        me.windowstate=vbminimized
        MsgBox("Okay, So Long!", vbOKOnly, "Ignition")
    
    End If
    End Sub
    
    End Module
    Last edited by firoz.raj; August 31st, 2012 at 05:38 AM.

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Minimizing a Loaded Application and More

    Even Easier. go to an elevated command prompt and type: START /?

    Microsoft Windows [Version 6.2.9200]
    (c) 2012 Microsoft Corporation. All rights reserved.
    C:\Users\David>start /?
    Starts a separate window to run a specified program or command.

    START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
    [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
    [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
    [command/program] [parameters]

    "title" Title to display in window title bar.
    path Starting directory.
    B Start application without creating a new window. The
    application has ^C handling ignored. Unless the application
    enables ^C processing, ^Break is the only way to interrupt
    the application.
    I The new environment will be the original environment passed
    to the cmd.exe and not the current environment.
    MIN Start window minimized.
    MAX Start window maximized.
    SEPARATE Start 16-bit Windows program in separate memory space.
    SHARED Start 16-bit Windows program in shared memory space.
    LOW Start application in the IDLE priority class.
    NORMAL Start application in the NORMAL priority class.
    HIGH Start application in the HIGH priority class.
    REALTIME Start application in the REALTIME priority class.
    Press any key to continue . . .
    Or, right one CMD file. Start that. Note: You might have to elevate THAT to run as Admin, but that can start other apps.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Minimizing a Loaded Application and More

    Quote Originally Posted by firoz.raj View Post
    [/FONT][/COLOR]


    try the following ! .
    Code:
    Module Module1
    
    Sub Main()
    dim x as string
    
    
    x=MsgBox("Would you like to Ignite?", vbYesNo, "Ignition")
    if x=vbyes then
       Process.Start("K:\Program Files\Core Temp\Core Temp.exe")
       Process.Start("K:\Program Files\Core Temp\CoreTempGadget2.7.gadget")
    
    Else
        me.windowstate=vbminimized
        MsgBox("Okay, So Long!", vbOKOnly, "Ignition")
    
    End If
    End Sub
    
    End Module
    No
    Quote Originally Posted by dglienna View Post
    Even Easier. go to an elevated command prompt and type: START /?

    Microsoft Windows [Version 6.2.9200]
    (c) 2012 Microsoft Corporation. All rights reserved.


    Or, right one CMD file. Start that. Note: You might have to elevate THAT to run as Admin, but that can start other apps.
    and no

    Have a look into the ShowWindow API.

    By the way, this looks more like VB.NET code - am I correct? If it is indeed VB.NET, there are more options with your Process object that you could use
    Last edited by HanneSThEGreaT; September 1st, 2012 at 01:58 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured