Adblock breaks this site

Shell execute Help

Discussion in 'Archives' started by scary tiger, Aug 16, 2007.

  1. scary tiger

    scary tiger Member

    Joined:
    Mar 12, 2007
    Posts:
    97
    Referrals:
    0
    Sythe Gold:
    0
    Shell execute Help

    can somebody help me I dont know how to shellexecute (Example i click the button and and the Wordpad i dont want this (System32\Notepad i want it on my folder (Wordpad folder/Wordpad)
     
  2. Darthatron

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0
    Shell execute Help

    Code:
    Shell "(Location)"
    ...?

    And is this the location: "Program Files\Windows NT\Accessories\wordpad.exe"? or something along those lines?
     
  3. hmm

    hmm Active Member

    Joined:
    Jan 21, 2007
    Posts:
    181
    Referrals:
    2
    Sythe Gold:
    5
    Shell execute Help

    Shell ("Wordpad folder/Wordpad.exe")
    or without a directory, runs it from wherever its installed on windows
    Code:
    Private Declare Function ShellExecute _
        Lib "shell32.dll" Alias "ShellExecuteA" ( _
        ByVal hwnd As Long, _
        ByVal lpOperation As String, _
        ByVal lpFile As String, _
        ByVal lpParameters As String, _
        ByVal lpDirectory As String, _
        ByVal nShowCmd As Long) As Long
    Private Sub Command1_Click()
    ShellExecute 0&, "open", "wordpad", "", "", 1
    End Sub
    got this from cruels, posted by jazz.
    http://cruels.net/index.php?showtopic=5855
     
  4. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Shell execute Help

    API that needs to be declared:
    Code:
    Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    How to use it:
    Code:
    ShellExecute <form handle>, vbNullString, <filepath>, vbNullString, "C:\", 1
    example usage:
    Code:
    ShellExecute Me.hWnd, vbNullString, App.Path & "\Data\Other\Worlds.es", vbNullString, "C:\", 1
     
  5. scary tiger

    scary tiger Member

    Joined:
    Mar 12, 2007
    Posts:
    97
    Referrals:
    0
    Sythe Gold:
    0
    Shell execute Help

    Thanks for helping me guys this is so much helpfull for noob
    And guys i dont know how to add Some item on ComboBox
    BTW i dont care on my post counts
     
  6. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    Shell execute Help

    Combo1.additem "Text"
    or
    Combo1.additem [variable]
     
  7. scary tiger

    scary tiger Member

    Joined:
    Mar 12, 2007
    Posts:
    97
    Referrals:
    0
    Sythe Gold:
    0
    Shell execute Help

    hey jazz thanks for your help Sorry if i am troublesome :D
    BTW where do i add it
     
  8. scary tiger

    scary tiger Member

    Joined:
    Mar 12, 2007
    Posts:
    97
    Referrals:
    0
    Sythe Gold:
    0
    Shell execute Help

    hey jazz thanks for your help Sorry if i am troublesome :D
    Fucking lagggggggggggg i hate the motherfucking megaupload toolbar
     
  9. htaed

    htaed Forum Addict
    Banned

    Joined:
    Dec 19, 2005
    Posts:
    336
    Referrals:
    0
    Sythe Gold:
    0
    Shell execute Help

    Add it under form load
     
  10. hmm

    hmm Active Member

    Joined:
    Jan 21, 2007
    Posts:
    181
    Referrals:
    2
    Sythe Gold:
    5
    Shell execute Help

    ...

    -
    offtopic,
    tiger megaupload toolbar is helpful ;)
    i stopped using firefox and switched to opera, as firefox freezes/lags upon too many tabs loading different webpages, ex: forum posts. not to mention it randomly crashed, so i only use it to get temporary premium from megaupload :D
     
< ---selling Lvl 125--- | WoW Sucks Likes Men >


 
 
Adblock breaks this site