Вопрос по VB6

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by Loan97, 6 Jun 2011.

Thread Status:
Not open for further replies.
  1. Loan97

    Loan97 New Member

    Joined:
    2 Aug 2010
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0
    Да простит меня администрация, если делаю что-нибудь не так :D
    А проблема у меня такая: нужно реализовать такую программу, как в пуске(анологичную "Выполнить"). Всё довольно просто, прописываешь путь в TextBox, нажимаешь CommandButton и запрос выполняется.
    Я новичок, так что сильно не ругайтесь за тупость:D
     
  2. xophet

    xophet Member

    Joined:
    16 Apr 2011
    Messages:
    617
    Likes Received:
    49
    Reputations:
    5
    http://tinyurl.com/3lsde2t
    И впредь сначала там, потом сюда)
    Там в выдаче посмотри www.vbforums.com.
    Там даже с примером.
     
  3. Loan97

    Loan97 New Member

    Joined:
    2 Aug 2010
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0
    конечно же я искал:D и не нашел:D

    ХЕЛП
     
    #3 Loan97, 6 Jun 2011
    Last edited: 6 Jun 2011
  4. BrainDeaD

    BrainDeaD Elder - Старейшина

    Joined:
    9 Jun 2005
    Messages:
    774
    Likes Received:
    292
    Reputations:
    214
    Code:
    Private Sub CommandButton _Click() 
     
        PID = Shell(TextBox.Text, vbNormalFocus)
     
    End Sub
     
    1 person likes this.
  5. patcher

    patcher Banned

    Joined:
    15 Dec 2009
    Messages:
    190
    Likes Received:
    37
    Reputations:
    10
    Кури ShellExecute (http://msdn.microsoft.com/en-us/library/bb762153%28v=vs.85%29.aspx)
     
  6. xophet

    xophet Member

    Joined:
    16 Apr 2011
    Messages:
    617
    Likes Received:
    49
    Reputations:
    5
    я за тебя даже запрос ввел, и сказал на каком сайте смотреть, а ты...
    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", "C:\rar.exe a -r -ep1 -v", vbNullString, vbNullString, vbHidden
    End Sub 
     
  7. Loan97

    Loan97 New Member

    Joined:
    2 Aug 2010
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0

    И как?? не фурычит(((
     
  8. xophet

    xophet Member

    Joined:
    16 Apr 2011
    Messages:
    617
    Likes Received:
    49
    Reputations:
    5
    ....
     
  9. Loan97

    Loan97 New Member

    Joined:
    2 Aug 2010
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0
    Мне нужно что-то типо такого, а на сайте не понятно((((

    [​IMG]

    или так :

    [​IMG]

    ХЕЛП
     
  10. patcher

    patcher Banned

    Joined:
    15 Dec 2009
    Messages:
    190
    Likes Received:
    37
    Reputations:
    10
    ТС, не ленись и соизволь хотя бы перейти по ссылке, что я давал выше, харош заниматься тупым копипастом.

    П.С. если с английским траблы, то можно поискать на русском по запросу ShellExecute VB6 и получим эту ссылку http://kbyte.ru/ru/Programming/Guides.aspx?id=193&mode=show. Неужели это так сложно? :confused:
     
    #10 patcher, 6 Jun 2011
    Last edited: 6 Jun 2011
    3 people like this.
  11. Loan97

    Loan97 New Member

    Joined:
    2 Aug 2010
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0
    Дак я переходил. Я еще совсем нуб в этом деле там вообще не понятно((
     
  12. Loan97

    Loan97 New Member

    Joined:
    2 Aug 2010
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0
    Аееееееееееееееееееееее:D:D:D
    Получилось!!!! Спасибо огромное:D


    Code:
    Option Explicit  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 Const SW_SHOWNORMAL = 1  Private Const SW_SHOWMAXIMIZED = 2  Private Const SW_SHOWMINIMIZED = 3    Private Sub Command1_Click()    ShellExecute 0, vbNullString, Text1.Text, vbNullString, vbNullString, SW_SHOWNORMAL  End Sub    
     
  13. C00LPack

    C00LPack Elder - Старейшина

    Joined:
    7 Oct 2010
    Messages:
    425
    Likes Received:
    72
    Reputations:
    19
    ТС нарк.
    Code:
    Private Sub Command1_Click()
    Shell (Text1.Text)
    Exd Sub
    
     
  14. Loan97

    Loan97 New Member

    Joined:
    2 Aug 2010
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0
    Тема закрыта :p
     
Thread Status:
Not open for further replies.