Προς το περιεχόμενο

Visual basic newbie help!


iSpO_fAcTo

Προτεινόμενες αναρτήσεις

// run Notepad<BR>WinExec('c:\windows\NOTEPAD.EXE', SW_SHOWNORMAL);<P>// run Notepad and display SomeText.txt<BR>WinExec('c:\windows\NOTEPAD.EXE C:\SomeText.txt',<BR> SW_SHOWNORMAL);<P>// execute a DOS DIR command<BR>WinExec('COMMAND.COM /C DIR *.*', SW_SHOWNORMAL);<P><BR>gia vb nomizo bazeis result = winexec(.....)<P>original source win32 prog refer.<P>The WinExec function runs the specified application. <P>This function is provided for compatibility with earlier versions of Windows. For Win32-based applications, use the CreateProcess function. <P>UINT WinExec(<P> LPCSTR lpCmdLine, // address of command line <BR> UINT uCmdShow // window style for new application <BR> ); <BR> <P>Parameters<P>lpCmdLine<P>Points to a null-terminated character string that contains the command line (filename plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, Windows searches for the executable file in this sequence: <P>1. The directory from which the application loaded. <BR> 2. The current directory. <BR> 3. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory. <BR> 4. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory. <BR> 5. The directories listed in the PATH environment variable. <P> <P>uCmdShow<P>Specifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function. For a non-Windows - based application, the PIF file, if any, for the application determines the window state. <P> <P>Return Values<P>If the function succeeds, the return value is greater than 31.<BR>If the function fails, the return value is one of the following error values: <P>Value Meaning<BR>0 The system is out of memory or resources.<BR>ERROR_BAD_FORMAT The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).<BR>ERROR_FILE_NOT_FOUND The specified file was not found.<BR>ERROR_PATH_NOT_FOUND The specified path was not found.<BR> <P>Remarks<P>Win32-based applications should use the CreateProcess function rather than this function. The WinExec function exists in Win32 to provide compatibility with earlier versions of Windows. For more information about how the WinExec function is implemented, see the Remarks section of the LoadModule function.<BR>In Win32, the WinExec function returns when the started process calls the GetMessage function or a time-out limit is reached. To avoid waiting for the time out delay, call the GetMessage function as soon as possible in any process started by a call to WinExec. <P>uCmdShow:<BR>Specifies how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. In subsequent calls, this parameter can be one of the following values: <P>Value Meaning<BR>SW_HIDE Hides the window and activates another window.<BR>SW_MAXIMIZE Maximizes the specified window.<BR>SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the Z order.<BR>SW_RESTORE Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.<BR>SW_SHOW Activates the window and displays it in its current size and position. <BR>SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. <BR>SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.<BR>SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.<BR>SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window remains active.<BR>SW_SHOWNA Displays the window in its current state. The active window remains active.<BR>SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.<BR>SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

Συνδέστε για να σχολιάσετε
Κοινοποίηση σε άλλες σελίδες

pos ginete na exo mia forma kai ena koubi kai patontas to na anigi ena exe arxio pou vriskete ston ipologisti aneksartita apo to idio to programma?<BR>gelia aporia to ksero alla plz help me:P<IMG SRC="http://www.insomnia.gr/cpubb/smilies/cwm11.gif" border=0>

Συνδέστε για να σχολιάσετε
Κοινοποίηση σε άλλες σελίδες

telos panton dokimase mia alli entoli:<BR>Result = Shell("c:\windows\notepad.exe", vbNormalFocus)<P>bebaia den einai api alla pios tin xezei smile.gif<P>PS: i proigoumeni itan api kai eltrexe loukoumi se delphi.<p>[This message has been edited by sh4dow (edited 26-02-2001).]

Συνδέστε για να σχολιάσετε
Κοινοποίηση σε άλλες σελίδες

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by APEKEPEOY:<BR><B>Για να καλέσεις ένα exe γραφεις call shell("όνομα αρχείου")<BR> π.χ call shell("c:\flash5.exe")</B><HR></BLOCKQUOTE><P>man to dokimasa kai doulevi thanx<IMG SRC="http://www.insomnia.gr/cpubb/smilies/cwm1.gif" border=0>

Συνδέστε για να σχολιάσετε
Κοινοποίηση σε άλλες σελίδες

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...