Last active
December 1, 2019 22:56
-
-
Save Linda-chan/b5d71f338852a5039053848bc62e833b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "windows.bi" | |
| #include "win\shellapi.bi" | |
| '==================================================================== | |
| Private Function MyCommand() As String | |
| Dim lpCmdLine As LPSTR | |
| Dim CmdLine As String | |
| Dim RC As Integer | |
| lpCmdLine = GetCommandLine() | |
| If lstrlen(lpCmdLine) = 0 Then | |
| MyCommand = "" | |
| Exit Function | |
| Else | |
| CmdLine = String(lstrlen(lpCmdLine) + 1, 0) | |
| lstrcpy CmdLine, lpCmdLine | |
| End If | |
| CmdLine = LTrim(CmdLine, Any !" \t\r\n") | |
| If Left(CmdLine, 1) = """" Then | |
| RC = InStr(2, CmdLine, """") | |
| If RC = 0 Then | |
| MyCommand = "" | |
| Exit Function | |
| End If | |
| RC = RC + 2 | |
| Else | |
| RC = InStr(CmdLine, " ") | |
| If RC = 0 Then | |
| MyCommand = "" | |
| Exit Function | |
| End If | |
| RC = RC + 1 | |
| End If | |
| MyCommand = Mid(CmdLine, RC) | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment