January 1, 2005

WinTask - WordCount

'
' WordCount - Count the number of words in a string

' Author: Joe Strazzere

'

a$="This is a test of the early warning system, here.  How well does it work?"

a$=Trim$(a)
i=1

pos=instr(a$," ")

While pos > 0
    i=i+1
    a$=Ltrim$(Mid$(a$,pos,Len(a$)))
    pos=instr(a$," ")
Wend

msgbox(str$(i))

 

Note that this is NOT the same as the value returned by the SplitIntoArray() function.

The WordCount snippet doesn't care if there are many spaces between words, while SplitIntoArray() does.

 

'
' Compare WordCount and SplitIntoArray
'
DIM testarray$(100)


a$=InputBox$("Enter a string", "Compare WordCount and SplitIntoArray", " This is just-a-test     ")
'a$="This  is      a test of the early warning system, here.   How well does it work?"
i=1
b$=a$

a$=Trim$(a$)
pos=instr(a$," ")

While pos > 0
   i=i+1
   a$=Ltrim$(Mid$(a$,pos,Len(a$)))
   pos=instr(a$," ")
Wend


valu=SplitIntoArray(b$,testarray$())

msgbox("["+b$+"]"+CRLF+CRLF+"WordCount sees "+str$(i)+" words."+CRLF+CRLF+"SplitIntoArry sees "+str$(valu)+" words.")

WinTask - WNetGetConnection

'
' WNetGetConnection - get the name of the network resource associated with a local device
'

' Author: Joe Strazzere
'

' WNetGetConnection(
'  LPCTSTR lpLocalName,  // local name
'  LPTSTR lpRemoteName,  // buffer for remote name
'  LPDWORD lpnLength     // buffer size
');

 

dim ptr1 as unsigned
dim ptr2 as unsigned
dim ptr3 as unsigned

 

ptr1=allocate(255)
ptr2=allocate(255)
ptr3=allocate(4)

 

local$ ="I:"     ' the local drive name
remote$="not found"  ' where the remote name goes

pokestring(ptr1,local$,1)
pokestring(ptr2,"                                                                ",1)
pokeinteger(ptr3,64,4)

 

ret = External("mpr","WNetGetConnectionA", ptr1, ptr2, ptr3)
remote$=peekstring$(ptr2)

 

If ret = 0 then
    msgbox(local$+" is really "+remote$,,"WNetGetConnection")
else
    msgbox("An error occurred trying to find "+local$+"  Return Code="+str$(ret))
EndIf

WinTask - WindowFromPoint

'
' WindowFromPoint
'
' Author: Joe Strazzere
'
' "user32" Alias "WindowFromPoint"
' (ByVal xPoint As Long,
' ByVal yPoint As Long) As Long

 

x=100
y=100

 

hwnd = External("user32","WindowFromPoint", x, x)

 

msgbox("The window at ("+str$(x)+","+str$(y)+") is:"+GetWindowName$(hwnd),,"WindowFromPoint")

WinTask - WeekDayName

'
' WeekDayName - Return the name of the day
'
' Author: Joe Strazzere
'

'

Function WeekDayName$()
  Select Case WeekDay()
  Case 1
    WeekDayName$ = "Sunday"
  Case 2
    WeekDayName$ = "Monday"
  Case 3
    WeekDayName$ = "Tuesday"
  Case 4
    WeekDayName$ = "Wednesday"
  Case 5
    WeekDayName$ = "Thursday"
  Case 6
    WeekDayName$ = "Friday"
  Case 7
    WeekDayName$ = "Saturday"
  Case Else
    WeekDayName$ = "I'm lost. I don't know what day it is."
  EndSelect

EndFunction

 

msgbox("Today is "+WeekDayName$(),,"WeekDayName")

WinTask - WeekDayAbbr

'
' WeekDayAbbr - 3-character abbreviation of the weekday
'

'
' Author: Joe Strazzere
'

Function WeekDayAbbr$()
  Local wdnint
  wdnint = WeekDay()
  Select Case wdnint
  Case 1
    WeekDayAbbr$ = "Sun"
  Case 2
    WeekDayAbbr$ = "Mon"
  Case 3
    WeekDayAbbr$ = "Tue"
  Case 4
    WeekDayAbbr$ = "Wed"
  Case 5
    WeekDayAbbr$ = "Thu"
  Case 6
    WeekDayAbbr$ = "Fri"
  Case 7
    WeekDayAbbr$ = "Sat"
  Case Else
    WeekDayAbbr$ = "???"
  EndSelect
EndFunction

 

msgbox("Today is "+WeekDayAbbr$(),,"WeekDayAbbr")

WinTask - WaveOutGetNumDevs

'
' WaveOutGetNumDevs
'

'
' Author: Joe Strazzere
'

' waveOutGetNumDevs Lib "winmm" () As Long

 

a=External("winmm","waveOutGetNumDevs")

 

If a > 0 then
  msgbox("This system has "+str$(a)+" device(s) which can play .WAV files",,"WaveOutGetNumDevs")
else
  msgbox("This system cannot play .WAV files",,"WaveOutGetNumDevs")
endif

WinTask - WaitForInputIdle

'
' WaitForInputIdle
'

' Author: Joe Strazzere

'

' This Script will wait until a given window becomes "Idle" - that is:
' waiting for input
' with no input pending
'
' You specify the handle of the window, and a timeout value in milliseconds.
' The script will wait until either the window is idle, or the timeout expires.
'

 

dim hwnd as unsigned
dim pid as unsigned
dim hpid as unsigned

 

'pid=allocate(8)

 

hwnd=GetWindowHandle(Top$(),1)

 

ret=External("user32","GetWindowThreadProcessId",hwnd,pid)
hpid=External("kernel32","OpenProcess",1024,1,pid)
ret=External("user32","WaitForInputIdle",hpid,10000)

 

msgbox(str$(ret))

WinTask - VerLanguageName

'
' VerLanguageName
'

' Author: Joe Strazzere

'

' retrieves a description string for the language associated with
' a specified binary Microsoft language identifier
'

' "kernel32" Alias "VerLanguageNameA"
'   (ByVal wLang As Long,
'    ByVal szLang As String,
'    ByVal nSize As Long) As Long
'


dim ptr as unsigned


ptr=allocate(255)

 

'0 = Language Neutral
'1033 = US Englisk
'2057 = UK English
'1036 = French
'3081 = Australian English
'1031 = German
'etc

LCID=1033

 

ret = External("kernel32","VerLanguageNameA",LCID, ptr,255)

var$=PeekString$(ptr)

 

msgbox("The language for LCID "+Str$(LCID)+" is: "+var$,,"VerLanguageName")

WinTask - URLUnescape

'
' UrlUnescape - Converts escape sequences back into ordinary characters.
'

' Author: Joe Strazzere

'

 

Dim OldURL as unsigned
Dim NewURL as unsigned
Dim count as unsigned
Dim flags as unsigned

 

OldURL=Allocate(100)
NewURL=Allocate(100)
Count=Allocate(100)
Flags=Allocate(100)

 

PokeString(OldURL,"http://www.zerble.com/arg=A%20B%20C",1)
'PokeString(OldURL,"This is a test",1)
PokeString(NewURL,"                                                                                                    ",1)
PokeInteger(Count,100,4)  ' the intial length of NewURL goes here, the new length is returned here
PokeInteger(Flags,0,4)

 

ret=External("shlwapi.dll","UrlUnescapeA",OldURL,NewURL, count, flags)
msgbox(ret)

 

ret=PeekInteger(count,4)
NewURL$=PeekString$(NewURL)
msgbox(Str$(ret)+" characters ="+NewURL$)

WinTask - UrlGetPart

'
' UrlGetPart - Takes a URL string and returns a specified part
'

' Author: Joe Strazzere

'


dim ptr1 as unsigned
dim ptr2 as unsigned
dim ptr3 as unsigned

ptr1=allocate(255)
ptr2=allocate(255)
ptr3=allocate(4)

 

URL_PART_SCHEME  = 1
URL_PART_HOSTNAME  = 2
URL_PART_USERNAME  = 3
URL_PART_PASSWORD  = 4
URL_PART_PORT   = 5
URL_PART_QUERY   = 6

 

'mystring$="http://172.16.1.103/Scripts/CustomerReg.asp"
mystring$="http://joe:password@www.mysite.com:8080/dir/index.html?test=1"

'1 = URL_PART_SCHEME   = http
'2 = URL_PART_HOSTNAME = www.mysite.com
'3 = URL_PART_USERNAME = joe
'4 = URL_PART_PASSWORD = password
'5 = URL_PART_PORT     = 8080
'6 = URL_PART_QUERY    = test=1

 

pokestring(ptr1,mystring$,1)
pokestring(ptr2,"                                                                                              ",1)
pokeinteger(ptr3,94,4)

 

ret=External("shlwapi.dll", "UrlGetPartA", ptr1, ptr2, ptr3, URL_PART_HOSTNAME,0)

 

var$=peekstring$(ptr2)

 

msgbox(var$,,"UrlGetPart")

WinTask - UrlGetLocation

'
' UrlGetLocation -
'

' Author: Joe Strazzere

'


'UrlGetLocation(
'  LPCTSTR pszURL)


dim ptr1 as unsigned
dim ptr2 as unsigned

ptr1=allocate(255)
ptr2=allocate(255)

pokestring(ptr1,"http://joe:password@www.mysite.com:8080/dir/index.html#the+location",1)

ptr2=External("shlwapi.dll", "UrlGetLocationA", ptr1)

 

msgbox(peekstring$(ptr2))

WinTask - UrlEscape

'
' UrlEscape - Converts characters in a URL that might be altered during transport across the Internet
'     ("unsafe" characters) into their corresponding escape sequences.
'

' Author: Joe Strazzere

'


Dim OldURL as unsigned
Dim NewURL as unsigned
Dim count as unsigned
Dim flags as unsigned

 

OldURL=Allocate(100)
NewURL=Allocate(100)
Count=Allocate(100)
Flags=Allocate(100)

 

PokeString(OldURL,"http://www.zapdata.com/arg=A B C",1)
'PokeString(OldURL,"This is a test",1)
PokeString(NewURL,"                                                                                                    ",1)

PokeInteger(Count,100,4)  ' the intial length of NewURL goes here, the new length is returned here
PokeInteger(Flags,0,4)

 

ret=External("shlwapi.dll","UrlEscapeA",OldURL,NewURL, count, flags)

msgbox(ret)

 

ret=PeekInteger(count,4)
NewURL$=PeekString$(NewURL)
msgbox(Str$(ret)+" characters ="+NewURL$)

WinTask - URLDownloadToFile

'
' URLDownloadToFile - Downloads bits from the Internet and saves them to a file.
'
'
' Author: Joe Strazzere
'

Function DownloadFile(URL$, LocalFilename$)
    External("urlmon.dll", "URLDownloadToFileA", 0, URL$, LocalFilename$, 0, 0)
EndFunction

DownloadFile("http://www.unitedmedia.com/comics/dilbert/archive/images/dilbert2003016263926.gif", "c:joetest.gif")

WinTask - UrlCanonicalize

'
' UrlCanonicalize -
'

' Author: Joe Strazzere

'


dim ptr1 as unsigned
dim ptr2 as unsigned
dim ptr3 as unsigned
dim URL_ESCAPE_PERCENT as unsigned
dim URL_ESCAPE_SPACES_ONLY as unsigned
dim URL_DONT_SIMPLIFY as unsigned
dim URL_UNESCAPE as unsigned
dim URL_ESCAPE_UNSAFE as unsigned
dim URL_PLUGGABLE_PROTOCOL as unsigned

ptr1=allocate(255)
ptr2=allocate(260)
ptr3=allocate(4)

 

'Private Const MAX_PATH                As Long = 260
'Private Const ERROR_SUCCESS           As Long = 0

'Convert any occurrence of '%' to
'its escape sequence.
URL_ESCAPE_PERCENT = 4096           '&H1000

 

'Replace only spaces with escape
'sequences. This flag takes precedence
'over URL_ESCAPE_UNSAFE, but does not
'apply to opaque URLs.
URL_ESCAPE_SPACES_ONLY = 67108864   '&H4000000

 

'Treat '/./' and '/../' in a URL string
'as literal characters, not as shorthand
'for navigation.
URL_DONT_SIMPLIFY = 134217728 '&H8000000

 

'Unescape any escape sequences that
'the URLs contain, with two exceptions.
'The escape sequences for '?' and '#'
'will not be unescaped. If one of the
'URL_ESCAPE_XXX flags is also set, the
'two URLs will unescaped, then combined,
'then escaped.
URL_UNESCAPE = 268435456 '&H10000000

 

'Replace unsafe values with their
'escape sequences. This flag applies
'to all URLs, including opaque URLs.
URL_ESCAPE_UNSAFE = 536870912 '&H20000000

 

'Combine URLs with client-defined
'pluggable protocols, according to
'the W3C specification. This flag
'does not apply to standard protocols
'such as ftp, http, gopher, and so on.
'If this flag is set, UrlCombine will
'not simplify URLs, so there is no need
'to also set URL_DONT_SIMPLIFY.
URL_PLUGGABLE_PROTOCOL = 1073741824 '&H40000000

 

' Private Declare Function UrlCanonicalize Lib "shlwapi" _
'   Alias "UrlCanonicalizeA" _
'  (ByVal pszURL As String, _
'   ByVal pszCanonicalized As String, _
'   pcchCanonicalized As Long, _
'   ByVal dwFlags As Long) As Long

'mystring$="http://www.wintast.com/index.htm?this is a test"

 

mystring$="This is a test for me."

pokestring(ptr1,mystring$,1)
pokestring(ptr2,"                                                                                                                                                                                                                                                                   ",1)
pokeinteger(ptr3,260,4)

 

ret=External("shlwapi.dll", "UrlCanonicalizeA", ptr1, ptr2, ptr3, URL_ESCAPE_SPACES_ONLY)

 

var$=peekstring$(ptr2)

 

msgbox(var$,,"UrlCanonicalize")

WinTask - Tone

'

' Tone
'
' Works like Beep, except you can specify a duration as well as a frequency
'
' Author: Joe Strazzere

'

 

External("kernel32","Beep",500,500)
External("kernel32","Beep",1000,500)
External("kernel32","Beep",1500,500)

WinTask - SwapMouseButton

'
' SwapMouseButton - reverses or restores the meaning of the left and right mouse buttons.
'
' Author: Joe Strazzere
'

Function SwapMouseButton(int)
    External("user32","SwapMouseButton", int)
EndFunction

'
' To swap the buttons, call it this way:
'
SwapMouseButton(1)

msgbox("The buttons have been reversed.  Try it here!")

'
' To restore the buttons, call it this way:
'
SwapMouseButton(0)
msgbox("The buttons have been restored.  Try it here!")

WinTask - SysMenuDump

'
' SysMenuDump
'
' Author: Joe Strazzere
'
menustring$="                                                                "

hwnd=GetWindowHandle(top$(),1)
hmenu=External("user32","GetSystemMenu", hwnd, 0)
menucount=External("user32", "GetMenuItemCount", hMenu)
i=o
while i < menucount
  External("user32","GetMenuStringA",hmenu,i,menustring$,64,-1)
 If menustring$ = "" then
    Comment("----- Separator -----")
    else
     Comment(menustring$)
    endif
   hsubmenu=External("user32", "GetSubMenu", hMenu, i)
   submenucount=External("user32", "GetMenuItemCount", hsubMenu)
    j=0
   while j < submenucount
     External("user32","GetMenuStringA",hsubmenu,j,menustring$,64,-1)
     If menustring$ = "" then
      Comment("    ----- Separator -----")
     else
      Comment("    "+menustring$)
     endif
   j=j+1
   wend
i=i+1
wend

WinTask - SubStr$

'
' SubStr$() - return a substring from a target string
'
'
' Author: Joe Strazzere
'

Function SubStr$(in$, position, length)
    SubStr$ = Left$(Right$(in$,(len(in$) - (position - 1))),length)
EndFunction

Big$="1234567890"
a$=SubStr$(Big$,5,3)
msgbox("["+a$+"]")

WinTask - Stuff$

'
' Stuff$()
'
' Author: Joe Strazzere
'

'
' Stuff$(Target$, iPos, iLen, Replace$)
'
' Replace iLen characters in the target string Target$, beginning at iPos
' with the string Replace$

Function Stuff$(Target$, iPos, iLen, Replace$)
    Stuff$=Left$(Target$, iPos-1)+Replace$+Right$(Target$, Len(Target$)-iPos-iLen+1)
EndFunction

Msgbox("Insert   "    +Stuff$("abcdef",2,0,"123"),,"Stuff$")    ' a123bcdef
Msgbox("Replace   "    +Stuff$("abcdef",2,3,"123"),,"Stuff$") ' a123ef
Msgbox("Delete   "    +Stuff$("abcdef",2,2,""),,"Stuff$")  ' adef
Msgbox("Replace/Insert   "+Stuff$("abcdef",2,1,"123"),,"Stuff$") ' a123cdef
Msgbox("Replace/Delete   "+Stuff$("abcdef",2,4,"123"),,"Stuff$") ' a123f

WinTask - StrTrim

'
' StrTrim - Remove all of a group of characters from the beginning and end of a string.
'
'   note: the search IS case-sensitive???
'

' Author: Joe Strazzere
'

 

a$="                       this is a test..................."
b$=" ."

 

ret=External("shlwapi.dll","StrTrimA",a$,b$)

msgbox("["+a$+"]")

WinTask - StrToInt

'
' StrToInt - convert a decimal string to an integer
'
' Author: Joe Strazzere
'

ret=External("shlwapi.dll","StrToIntA","1234.56")
msgbox(str$(ret))

ret=External("shlwapi.dll","StrToIntA","-1234.56")
msgbox(str$(ret))

WinTask - StrReverse

'
' StrReverse - Reverse a string
'
' Author: Joe Strazzere
'

Function StrReverse$(StrReverse1$)
    Local i
    Local work$
    i=Len(StrReverse1$)
    work$=""
    While i > 0
        work$=work$+Mid$(StrReverse1$,i,1)
        i=i-1
    Wend
    StrReverse$=work$
EndFunction

msgbox(StrReverse$("123"))

WinTask - StrFromTimeInterval

'
' StrFromTimeInterval
'
' Author: Joe Strazzere
'

'External("shlwapi.dll","StrFromTimeIntervalA",pszOut,cchMax,dwTimeMS,digits)
'pszOut
'[out] Pointer to a character buffer that receives the converted string.
'cchMax
'[in] Size of pszOut, in characters. If cchMax is set to zero,
'     StrFromTimeInterval will return the minimum size of the character buffer
'     needed to hold the converted string. In this case, pszOut will not contain the converted string.
'dwTimeMS
'[in] Time interval, in milliseconds.
'digits
'[in] Maximum number of digits to be represented in pszOut. Some examples are:
' dwTimeMS digits pszOut
' 34000    3      34 sec
' 34000    2      34 sec
' 34000    1      30 sec
' 74000    3      1 min 14 sec
' 74000    2      1 min 10 sec
' 74000    1      1 min

a$="                                        "
ret=External("shlwapi.dll","StrFromTimeIntervalA",a$,40,74000,3)
msgbox(a$)
ret=External("shlwapi.dll","StrFromTimeIntervalA",a$,40,74000,2)
msgbox(a$)
ret=External("shlwapi.dll","StrFromTimeIntervalA",a$,40,74000,1)
msgbox(a$)

StartTimer(1)
pause 3 secs
i=Timer(1)*10
ret=External("shlwapi.dll","StrFromTimeIntervalA",a$,40,i,3)
msgbox(Str$(i)+" milliseconds = "+a$)
StopTimer(1)

WinTask - StrFormatByteSize

'
' StrFormatByteSize - format a number nicely
'

' Author: Joe Strazzere
'

' returns one of the following formats as appropriate:
'
'  nnn bytes
'  nnn KB
'  nnn MB
'  nnn GB
'

' "shlwapi" Alias "StrFormatByteSizeA" (ByVal _
' dw As Long, ByVal pszBuf As String, ByRef _
' cchBuf As Long) As String

 

dim ptr as unsigned

ptr=allocate(32)

pokestring(ptr,"                                ",1)

qtyin=1000000000

 

External("shlwapi", "StrFormatByteSizeA",qtyin, ptr, 32)

 

var$=peekstring$(ptr)

 

msgbox(var$)

WinTask - StrCSpnI

'
' StrCSpn - search a string for the first occurrence of any of a group of characters.
'   note: the search is NOT case-sensitive
'

' Author: Joe Strazzere
'

 

dim ptr1 as unsigned
dim ptr2 as unsigned

 

ptr1=allocate(255)
ptr2=allocate(255)

 

' the string in which to search
PokeString(ptr1,"This is, a test",1)

 

' the group of characters to search for
PokeString(ptr2,"ABC",1)

 

' returns the number of characters before the found character
ret=External("shlwapi.dll","StrCSpnIA",ptr1,ptr2)

msgbox(str$(ret))

WinTask - StrCSpn

'
' StrCSpn - search a string for the first occurrence of any of a group of characters.
'
' Author: Joe Strazzere

'

'   note: the search IS case-sensitive
'

'dim ptr1 as unsigned
'dim ptr2 as unsigned

'ptr1=allocate(255)
'ptr2=allocate(255)

' the string in which to search
'PokeString(ptr1,"This is, a test",1)

' the group of characters to search for
'PokeString(ptr2,",. ",1)

' returns the number of characters before the found character
'ret=External("shlwapi.dll","StrCSpnA",ptr1,ptr2)
'msgbox(str$(ret))


' returns the number of characters before the found character
ret=External("shlwapi.dll","StrCSpnA","This is a test.","., ")
msgbox(str$(ret))

WinTask - sprintf

'
' sprintf - return a formatted string
'

' Author: Joe Strazzere

'

 

'Formatting Specifications

'The first character of the format argument is always a percent sign (%).
'The last character of format is a letter code that determines the type of formatting.
'One or more format modifiers can appear between the first and last character of the format argument (see below).
'The possible letter codes are as follows:

' c  Prints a character from its decimal ASCII code.
' d  Prints the decimal integer portion of a number.
' e  Converts input to scientific notation.
' f  Pads with zeros to the right of the decimal point.
' g  Prints a decimal value while suppressing non-significant zeros.
' o  Prints the octal value of the integer portion of a number.
' s  Prints an unmodified string.
' x  Prints the hexadecimal value of the integer portion of a number.
'
' % Prints a literal percent sign (%).

'Modifying Formats

'The output generated by a particular formatting code can be modified.
'Three types of modifiers can appear between the percent sign (%) and the format code character:

' -  (justification) A hyphen (-) indicates that the printed output is to be left-justified in its field.
' field width   A number by itself or to the left of a decimal point,
'       indicates how many characters the field should be padded.
'       When this number is preceded by a 0, the padding is done with zeros
'      to the left of the printed value.
' precision    A number to the right of a decimal point indicates the maximum width
'       of the printed string or how many digits are printed to the right
'      of the output decimal point.

 

dim ptr as unsigned
ptr=allocate(255)

 

'ret=External("user32.dll", "wsprintfA", ptr, "[%255s]", "")
'ret=External("user32.dll", "wsprintfA", ptr, "[%x]", 45)

ret=External("user32.dll", "wsprintfA", ptr, "[%12d]", 45)

 

msgbox("Length of resulting string is "+str$(ret))

a$=peekstring$(ptr)
msgbox(a$)

WinTask - Space$

'
' Space$() - return a string with nn spaces
'

' Author: Joe Strazzere

'

 

Dim spaceptr as unsigned

 

Function Space$(nn)
    spaceptr=allocate(nn)
    External("user32.dll", "wsprintfA", spaceptr, "%"+str$(nn)+"s", "")
    Space$=peekstring$(spaceptr)
EndFunction

 

a$=Space$(123)

 

'msgbox("Length of resulting string is "+str$(Len(a$)),,"Space$")
msgbox("["+a$+"]",,"Space$")

WinTask - ShowFindDialog

'
' ShowFindDialog
'
' Author: Joe Strazzere
'
'Call ShowFindDialog("e:")
'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
  
'Const SW_SHOW = 5
'Public Sub ShowFindDialog(Optional InitialDirectory As String)
'ShellExecute 0, "find", _
'  IIf(InitialDirectory = "", "", InitialDirectory), _
'  vbNullString, vbNullString, SW_SHOW
'End Sub
ret=External("shell32.dll","ShellExecuteA",0,"find","d: est",0,0,5)
ret=External("shell32.dll","ShellExecuteA",0,"explore","d: est",0,0,5)
'msgbox(str$(ret))

WinTask - Space255

'
' Space255 - creates a string variable containing 255 spaces
'

' Author: Joe Strazzere

'

 

Space255$="                                                  "
Space255$=Space255$+"                                                  "
Space255$=Space255$+"                                                  "
Space255$=Space255$+"                                                  "
Space255$=Space255$+"                                                  "
Space255$=Space255$+"     "

WinTask - ShellExecute

'
' ShellExecute
'
' Author: Joe Strazzere
'

'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
  
'Const SW_SHOW = 5
'Public Sub ShowFindDialog(Optional InitialDirectory As String)
'ShellExecute 0, "find", _
'  IIf(InitialDirectory = "", "", InitialDirectory), _
'  vbNullString, vbNullString, SW_SHOW
'End Sub

'ret=External("shell32.dll","ShellExecuteA",0,"find","d: est",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"explore","d: est",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"print","d:wwf.doc",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"Open","d:wwf.doc",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"print","d:joe.txt",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"Open","d:joe.txt",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,0,"http://www.blogger.com/'mailto:joe.strazzere@fairmarket.com%22,0,0,5')
'ret=External("shell32.dll","ShellExecuteA",0,"View Dependencies","d:mini_golf.exe",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"Open","d: est.xml",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"Edit","d: est.xml",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"open","d:joe.bmp",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"open","d:joe.htm",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"Edit","d:joe.htm",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"EditWithVS","d:joe.htm",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"Open with Word","d:joe.htm",0,0,5)
'ret=External("shell32.dll","ShellExecuteA",0,"Print","d:joe.htm",0,0,5)
ret=External("shell32.dll","ShellExecuteA",0,"open","d:SwingSet2.jar",0,0,5)

WinTask - SHAddToRecentDocs

'
' SHAddToRecentDocs - add a file name to the Windows Documents list, or clears it
'
' Author: Joe Strazzere
'

' SHAddToRecentDocs Lib "shell32.dll" (ByVal uFlags As Long, ByVal pv As String)

fil$=InputBox$("File to be added to Recent list : ","SAddToRecentDocs", "c:autoexec.bat")

ret=External("shell32","SHAddToRecentDocs",2,fil$)
msgbox(fil$+" added to Documents list",,"SHAddToRecentDocs")

pause 3 secs

ret=External("shell32","SHAddToRecentDocs",2,0)    ' clears the Documents list
msgbox("Documents list cleared",,"SHAddToRecentDocs")

WinTask - ShellAbout

'
' ShellAbout - Display an About box
'
' Author: Joe Strazzere

'

 

'"shell32.dll" Alias "ShellAboutA"
'(ByVal hwnd As Long,
' ByVal szApp As String,
' ByVal szOtherStuff As String,
' ByVal hIcon As Long) As Long

ret=External("shell32.dll", "ShellAboutA", 0, "The First Part#The Second Part","The explanation"+Chr$(10)+"goes here.",0)

WinTask - GetClassName

'
' GetClassName
'
' Author: Joe Strazzere
'
' "user32" Alias "GetClassNameA"
' (ByVal hwnd As Long,
'  ByVal lpClassName As String,
'  ByVal nMaxCount As Long) As Long
'
Dim memptr as unsigned
Dim texlen as unsigned
memptr=allocate(255)
textlen=64
hwnd=GetWindowHandle(focus$(),1)
ret = External("user32","GetClassNameA", hwnd, memptr, textlen)
myclass$=peekstring$(memptr)
msgbox("The class of the window with the Focus is "+myclass$,,"GetClassName")

WinTask - GetAsyncKeyState

'
' GetAsyncKeyState - Get the current status of the specified virtual key.
'
' determines whether a key is up or down at the time the function is called,
' and whether the key was pressed after a previous call to GetAsyncKeyState.
'
' Author: Joe Strazzere
'

VK_CANCEL    = 3
VK_BACK   = 8
VK_TAB   = 9
VK_CLEAR  = 12
VK_RETURN  = 13
VK_SHIFT  = 16
VK_CONTROL  = 17
VK_MENU   = 18
VK_PAUSE  = 19
VK_CAPITAL  = 20
VK_ESCAPE  = 27
VK_SPACE  = 32
VK_PRIOR  = 33
VK_NEXT      = 34
VK_END       = 35
VK_HOME      = 36
VK_LEFT      = 37
VK_UP        = 38
VK_RIGHT     = 39
VK_DOWN      = 40
VK_SELECT    = 41
VK_PRINT     = 42
VK_EXECUTE   = 43
VK_SNAPSHOT  = 44
VK_INSERT  = 45
VK_DELETE    = 46
VK_HELP      = 47
'  VK_0 thru VK_9 are the same as ASCII '0' thru '9' (&H30& - &H39)
VK_0   = Asc("0")
'  VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (&H41& - &H5A)
VK_A   = Asc("A")
VK_NUMPAD0    = 96
VK_NUMPAD1    = 97
VK_NUMPAD2    = 98
VK_NUMPAD3    = 99
VK_NUMPAD4    = 100
VK_NUMPAD5    = 101
VK_NUMPAD6    = 102
VK_NUMPAD7    = 103
VK_NUMPAD8    = 104
VK_NUMPAD9    = 105
VK_MULTIPLY   = 106
VK_ADD        = 107
VK_SEPARATOR  = 108
VK_SUBTRACT   = 109
VK_DECIMAL   = 110
VK_DIVIDE     = 111
VK_F1         = 112
VK_F2         = 113
VK_F3         = 114
VK_F4         = 115
VK_F5         = 116
VK_F6         = 117
VK_F7         = 118
VK_F8         = 119
VK_F9         = 120
VK_F10        = 121
VK_F11        = 122
VK_F12        = 123
VK_F13        = 124
VK_F14        = 125
VK_F15        = 126
VK_F16        = 127
VK_F17        = 128
VK_F18        = 129
VK_F19        = 130
VK_F20        = 131
VK_F21        = 132
VK_F22        = 133
VK_F23        = 134
VK_F24        = 135
VK_NumLock   = 144
VK_Scroll   = 145
'
' VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
' Used only as parameters to GetAsyncKeyState() and GetKeyState().
' No other API or message will distinguish left and right keys in this way.
'
VK_LSHIFT    = 160
VK_RSHIFT    = 161
VK_LCONTROL  = 162
VK_RCONTROL  = 163
VK_LMENU     = 164 
VK_RMENU     = 165
VK_ATTN      = 246
VK_CRSEL     = 247
VK_EXSEL     = 248
VK_EREOF     = 249
VK_PLAY      = 250
VK_ZOOM      = 251
VK_NONAME    = 252
VK_PA1       = 253
VK_OEM_CLEAR = 254
ret=External("user32","GetAsyncKeyState", VK_RSHIFT )
MsgBox(Str$(ret))

WinTask - GetBinaryType

'
' GetBinaryType
'
' Author: Joe Strazzere
'

Dim ptr as unsigned
ptr=Allocate(128)
PokeString(ptr,"C:JoeStuffTAIL.EXE",2)
ret=External("kernel32","GetBinaryTypeA", ptr, ret2)
msgbox(ret)

WinTask - GetActiveWindow

'
' GetActiveWindow
'
' Author: Joe Strazzere
'
'Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
'dim namefen$(210)
'dim numinst(210)
'dim handlefen(210)
'dim fenflag$(210)

'p=GetWindowsList(namefen$(),numinst(),handlefen(),fenflag$())
'msgbox(Str$(p))
'i=0
'while i<p
'  if left$(namefen$(i),7) = "NOTEPAD" then
'     msgbox(str$(handlefen(i)),,"NOTEPAD'S HANDLE")
'  endif
'  i=i+1
'wend
'pause 3 seconds
a = External("user32","GetForegroundWindow")
msgbox(Str$(a),,"GetActiveWindow")
msgbox(GetWindowName$(a))

WinTask - FlashWindow

'
' FlashWindow - Flash the Titlebar of a Window
'
' Author: Joe Strazzere
'
pause 3 seconds
b = External("user32","GetForegroundWindow")
External("user32","FlashWindow",b,1)
pause 1 seconds
External("user32","FlashWindow",b,0)
pause 1 seconds
External("user32","FlashWindow",b,1)
pause 1 seconds
External("user32","FlashWindow",b,0)
pause 1 seconds
External("user32","FlashWindow",b,1)
pause 1 seconds
External("user32","FlashWindow",b,0)
pause 1 seconds

WinTask - FormatDrive

'
' FormatDrive (for floppy disk only)
'
' Author: Joe Strazzere
'
'rundll32.exe shell32.dll,SHFormatDrive
Shell ("rundll32.exe shell32.dll,SHFormatDrive") 

WinTask - ErrorCodeText

'
' ErrorCodeText
'
' Author: Joe Strazzere
'

Dim ErrorCode$(6118)
Function GetErrorCode$(errornumber)
  If errornumber < 0 or errornumber > 6118 then
   GetErrorCode$ = "*** Unknown Error ***"
  Else
   GetErrorCode$ = ErrorCode$(errornumber)
  EndIf
EndFunction
i=0
While i <=6118
  ErrorCode$(i) = "*** Unknown Error ***"
  i=i+1
Wend
ErrorCode$(0)= "SUCCESS"
ErrorCode$(1)= "INVALID FUNCTION"
ErrorCode$(2)= "FILE NOT FOUND"
ErrorCode$(3)= "PATH NOT FOUND"
ErrorCode$(4)= "TOO MANY OPEN FILES"
ErrorCode$(5)= "ACCESS DENIED"
ErrorCode$(6)= "INVALID HANDLE"
ErrorCode$(7)= "ARENA TRASHED"
ErrorCode$(8)= "NOT ENOUGH MEMORY"
ErrorCode$(9)= "INVALID BLOCK"
ErrorCode$(10)= "BAD ENVIRONMENT"
ErrorCode$(11)= "BAD FORMAT"
ErrorCode$(12)= "INVALID ACCESS"
ErrorCode$(13)= "INVALID DATA"
ErrorCode$(14)= "OUTOFMEMORY"
ErrorCode$(15)= "INVALID DRIVE"
ErrorCode$(16)= "CURRENT DIRECTORY"
ErrorCode$(17)= "NOT SAME DEVICE"
ErrorCode$(18)= "NO MORE FILES"
ErrorCode$(19)= "WRITE PROTECT"
ErrorCode$(20)= "BAD UNIT"
ErrorCode$(21)= "NOT READY"
ErrorCode$(22)= "BAD COMMAND"
ErrorCode$(23)= "CRC"
ErrorCode$(24)= "BAD LENGTH"
ErrorCode$(25)= "SEEK"
ErrorCode$(26)= "NOT DOS DISK"
ErrorCode$(27)= "SECTOR NOT FOUND"
ErrorCode$(28)= "OUT OF PAPER"
ErrorCode$(29)= "WRITE FAULT"
ErrorCode$(30)= "READ FAULT"
ErrorCode$(31)= "GEN FAILURE"
ErrorCode$(32)= "SHARING VIOLATION"
ErrorCode$(33)= "LOCK VIOLATION"
ErrorCode$(34)= "WRONG DISK"
ErrorCode$(36)= "SHARING BUFFER EXCEEDED"
ErrorCode$(38)= "HANDLE EOF"
ErrorCode$(39)= "HANDLE DISK FULL"
ErrorCode$(50)= "NOT SUPPORTED"
ErrorCode$(51)= "REM NOT LIST"
ErrorCode$(52)= "DUP NAME"
ErrorCode$(53)= "BAD NETPATH"
ErrorCode$(54)= "NETWORK BUSY"
ErrorCode$(55)= "DEV NOT EXIST"
ErrorCode$(56)= "TOO MANY CMDS"
ErrorCode$(57)= "ADAP HDW ERR"
ErrorCode$(58)= "BAD NET RESP"
ErrorCode$(59)= "UNEXP NET ERR"
ErrorCode$(60)= "BAD REM ADAP"
ErrorCode$(61)= "PRINTQ FULL"
ErrorCode$(62)= "NO SPOOL SPACE"
ErrorCode$(63)= "PRINT CANCELLED"
ErrorCode$(64)= "NETNAME DELETED"
ErrorCode$(65)= "NETWORK ACCESS DENIED"
ErrorCode$(66)= "BAD DEV TYPE"
ErrorCode$(67)= "BAD NET NAME"
ErrorCode$(68)= "TOO MANY NAMES"
ErrorCode$(69)= "TOO MANY SESS"
ErrorCode$(70)= "SHARING PAUSED"
ErrorCode$(71)= "REQ NOT ACCEP"
ErrorCode$(72)= "REDIR PAUSED"
ErrorCode$(80)= "FILE EXISTS"
ErrorCode$(82)= "CANNOT MAKE"
ErrorCode$(83)= "FAIL I24"
ErrorCode$(84)= "OUT OF STRUCTURES"
ErrorCode$(85)= "ALREADY ASSIGNED"
ErrorCode$(86)= "INVALID PASSWORD"
ErrorCode$(87)= "INVALID PARAMETER"
ErrorCode$(88)= "NET WRITE FAULT"
ErrorCode$(89)= "NO PROC SLOTS"
ErrorCode$(100)= "TOO MANY SEMAPHORES"
ErrorCode$(101)= "EXCL SEM ALREADY OWNED"
ErrorCode$(102)= "SEM IS SET"
ErrorCode$(103)= "TOO MANY SEM REQUESTS"
ErrorCode$(104)= "INVALID AT INTERRUPT TIME"
ErrorCode$(105)= "SEM OWNER DIED"
ErrorCode$(106)= "SEM USER LIMIT"
ErrorCode$(107)= "DISK CHANGE"
ErrorCode$(108)= "DRIVE LOCKED"
ErrorCode$(109)= "BROKEN PIPE"
ErrorCode$(110)= "OPEN FAILED"
ErrorCode$(111)= "BUFFER OVERFLOW"
ErrorCode$(112)= "DISK FULL"
ErrorCode$(113)= "NO MORE SEARCH HANDLES"
ErrorCode$(114)= "INVALID TARGET HANDLE"
ErrorCode$(117)= "INVALID CATEGORY"
ErrorCode$(118)= "INVALID VERIFY SWITCH"
ErrorCode$(119)= "BAD DRIVER LEVEL"
ErrorCode$(120)= "CALL NOT IMPLEMENTED"
ErrorCode$(121)= "SEM TIMEOUT"
ErrorCode$(122)= "INSUFFICIENT BUFFER"
ErrorCode$(123)= "INVALID NAME"
ErrorCode$(124)= "INVALID LEVEL"
ErrorCode$(125)= "NO VOLUME LABEL"
ErrorCode$(126)= "MOD NOT FOUND"
ErrorCode$(127)= "PROC NOT FOUND"
ErrorCode$(128)= "WAIT NO CHILDREN"
ErrorCode$(129)= "CHILD NOT COMPLETE"
ErrorCode$(130)= "DIRECT ACCESS HANDLE"
ErrorCode$(131)= "NEGATIVE SEEK"
ErrorCode$(132)= "SEEK ON DEVICE"
ErrorCode$(133)= "IS JOIN TARGET"
ErrorCode$(134)= "IS JOINED"
ErrorCode$(135)= "IS SUBSTED"
ErrorCode$(136)= "NOT JOINED"
ErrorCode$(137)= "NOT SUBSTED"
ErrorCode$(138)= "JOIN TO JOIN"
ErrorCode$(139)= "SUBST TO SUBST"
ErrorCode$(140)= "JOIN TO SUBST"
ErrorCode$(141)= "SUBST TO JOIN"
ErrorCode$(142)= "BUSY DRIVE"
ErrorCode$(143)= "SAME DRIVE"
ErrorCode$(144)= "DIR NOT ROOT"
ErrorCode$(145)= "DIR NOT EMPTY"
ErrorCode$(146)= "IS SUBST PATH"
ErrorCode$(147)= "IS JOIN PATH"
ErrorCode$(148)= "PATH BUSY"
ErrorCode$(149)= "IS SUBST TARGET"
ErrorCode$(150)= "SYSTEM TRACE"
ErrorCode$(151)= "INVALID EVENT COUNT"
ErrorCode$(152)= "TOO MANY MUXWAITERS"
ErrorCode$(153)= "INVALID LIST FORMAT"
ErrorCode$(154)= "LABEL TOO LONG"
ErrorCode$(155)= "TOO MANY TCBS"
ErrorCode$(156)= "SIGNAL REFUSED"
ErrorCode$(157)= "DISCARDED"
ErrorCode$(158)= "NOT LOCKED"
ErrorCode$(159)= "BAD THREADID ADDR"
ErrorCode$(160)= "BAD ARGUMENTS"
ErrorCode$(161)= "BAD PATHNAME"
ErrorCode$(162)= "SIGNAL PENDING"
ErrorCode$(164)= "MAX THRDS REACHED"
ErrorCode$(167)= "LOCK FAILED"
ErrorCode$(170)= "BUSY"
ErrorCode$(173)= "CANCEL VIOLATION"
ErrorCode$(174)= "ATOMIC LOCKS NOT SUPPORTED"
ErrorCode$(180)= "INVALID SEGMENT NUMBER"
ErrorCode$(182)= "INVALID ORDINAL"
ErrorCode$(183)= "ALREADY EXISTS"
ErrorCode$(186)= "INVALID FLAG NUMBER"
ErrorCode$(187)= "SEM NOT FOUND"
ErrorCode$(188)= "INVALID STARTING CODESEG"
ErrorCode$(189)= "INVALID STACKSEG"
ErrorCode$(190)= "INVALID MODULETYPE"
ErrorCode$(191)= "INVALID EXE SIGNATURE"
ErrorCode$(192)= "EXE MARKED INVALID"
ErrorCode$(193)= "BAD EXE FORMAT"
ErrorCode$(194)= "ITERATED DATA EXCEEDS 64k"
ErrorCode$(195)= "INVALID MINALLOCSIZE"
ErrorCode$(196)= "DYNLINK FROM INVALID RING"
ErrorCode$(197)= "IOPL NOT ENABLED"
ErrorCode$(198)= "INVALID SEGDPL"
ErrorCode$(199)= "AUTODATASEG EXCEEDS 64k"
ErrorCode$(200)= "RING2SEG MUST BE MOVABLE"
ErrorCode$(201)= "RELOC CHAIN XEEDS SEGLIM"
ErrorCode$(202)= "INFLOOP IN RELOC CHAIN"
ErrorCode$(203)= "ENVVAR NOT FOUND"
ErrorCode$(205)= "NO SIGNAL SENT"
ErrorCode$(206)= "FILENAME EXCED RANGE"
ErrorCode$(207)= "RING2 STACK IN USE"
ErrorCode$(208)= "META EXPANSION TOO LONG"
ErrorCode$(209)= "INVALID SIGNAL NUMBER"
ErrorCode$(210)= "THREAD 1 INACTIVE"
ErrorCode$(212)= "LOCKED"
ErrorCode$(214)= "TOO MANY MODULES"
ErrorCode$(215)= "NESTING NOT ALLOWED"
ErrorCode$(230)= "BAD PIPE"
ErrorCode$(231)= "PIPE BUSY"
ErrorCode$(232)= "NO DATA"
ErrorCode$(233)= "PIPE NOT CONNECTED"
ErrorCode$(234)= "MORE DATA"
ErrorCode$(240)= "VC DISCONNECTED"
ErrorCode$(254)= "INVALID EA NAME"
ErrorCode$(255)= "EA LIST INCONSISTENT"
ErrorCode$(259)= "NO MORE ITEMS"
ErrorCode$(266)= "CANNOT COPY"
ErrorCode$(267)= "DIRECTORY"
ErrorCode$(275)= "EAS DIDNT FIT"
ErrorCode$(276)= "EA FILE CORRUPT"
ErrorCode$(277)= "EA TABLE FULL"
ErrorCode$(278)= "INVALID EA HANDLE"
ErrorCode$(282)= "EAS NOT SUPPORTED"
ErrorCode$(288)= "NOT OWNER"
ErrorCode$(298)= "TOO MANY POSTS"
ErrorCode$(317)= "MR MID NOT FOUND"
ErrorCode$(487)= "INVALID ADDRESS"
ErrorCode$(534)= "ARITHMETIC OVERFLOW"
ErrorCode$(535)= "PIPE CONNECTED"
ErrorCode$(536)= "PIPE LISTENING"
ErrorCode$(994)= "EA ACCESS DENIED"
ErrorCode$(995)= "OPERATION ABORTED"
ErrorCode$(996)= "IO INCOMPLETE"
ErrorCode$(997)= "IO PENDING"
ErrorCode$(998)= "NOACCESS"
ErrorCode$(999)= "SWAPERROR"
ErrorCode$(1001)= "STACK OVERFLOW"
ErrorCode$(1002)= "INVALID MESSAGE"
ErrorCode$(1003)= "CAN NOT COMPLETE"
ErrorCode$(1004)= "INVALID FLAGS"
ErrorCode$(1005)= "UNRECOGNIZED VOLUME"
ErrorCode$(1006)= "FILE INVALID"
ErrorCode$(1007)= "FULLSCREEN MODE"
ErrorCode$(1008)= "NO TOKEN"
ErrorCode$(1009)= "BADDB"
ErrorCode$(1010)= "BADKEY"
ErrorCode$(1011)= "CANTOPEN"
ErrorCode$(1012)= "CANTREAD"
ErrorCode$(1013)= "CANTWRITE"
ErrorCode$(1014)= "REGISTRY RECOVERED"
ErrorCode$(1015)= "REGISTRY CORRUPT"
ErrorCode$(1016)= "REGISTRY IO FAILED"
ErrorCode$(1017)= "NOT REGISTRY FILE"
ErrorCode$(1018)= "KEY DELETED"
ErrorCode$(1019)= "NO LOG SPACE"
ErrorCode$(1020)= "KEY HAS CHILDREN"
ErrorCode$(1021)= "CHILD MUST BE VOLATILE"
ErrorCode$(1022)= "NOTIFY ENUM DIR"
ErrorCode$(1051)= "DEPENDENT SERVICES RUNNING"
ErrorCode$(1052)= "INVALID SERVICE CONTROL"
ErrorCode$(1053)= "SERVICE REQUEST TIMEOUT"
ErrorCode$(1054)= "SERVICE NO THREAD"
ErrorCode$(1055)= "SERVICE DATABASE LOCKED"
ErrorCode$(1056)= "SERVICE ALREADY RUNNING"
ErrorCode$(1057)= "INVALID SERVICE ACCOUNT"
ErrorCode$(1058)= "SERVICE DISABLED"
ErrorCode$(1059)= "CIRCULAR DEPENDENCY"
ErrorCode$(1060)= "SERVICE DOES NOT EXIST"
ErrorCode$(1061)= "SERVICE CANNOT ACCEPT CTRL"
ErrorCode$(1062)= "SERVICE NOT ACTIVE"
ErrorCode$(1063)= "FAILED SERVICE CONTROLLER CONNECT"
ErrorCode$(1064)= "EXCEPTION IN SERVICE"
ErrorCode$(1065)= "DATABASE DOES NOT EXIST"
ErrorCode$(1066)= "SERVICE SPECIFIC ERROR"
ErrorCode$(1067)= "PROCESS ABORTED"
ErrorCode$(1068)= "SERVICE DEPENDENCY FAIL"
ErrorCode$(1069)= "SERVICE LOGON FAILED"
ErrorCode$(1070)= "SERVICE START HANG"
ErrorCode$(1071)= "INVALID SERVICE LOCK"
ErrorCode$(1072)= "SERVICE MARKED FOR DELETE"
ErrorCode$(1073)= "SERVICE EXISTS"
ErrorCode$(1074)= "ALREADY RUNNING LKG"
ErrorCode$(1075)= "SERVICE DEPENDENCY DELETED"
ErrorCode$(1076)= "BOOT ALREADY ACCEPTED"
ErrorCode$(1077)= "SERVICE NEVER STARTED"
ErrorCode$(1078)= "DUPLICATE SERVICE NAME"
ErrorCode$(1100)= "END OF MEDIA"
ErrorCode$(1101)= "FILEMARK DETECTED"
ErrorCode$(1102)= "BEGINNING OF MEDIA"
ErrorCode$(1103)= "SETMARK DETECTED"
ErrorCode$(1104)= "NO DATA DETECTED"
ErrorCode$(1105)= "PARTITION FAILURE"
ErrorCode$(1106)= "INVALID BLOCK LENGTH"
ErrorCode$(1107)= "DEVICE NOT PARTITIONED"
ErrorCode$(1108)= "UNABLE TO LOCK MEDIA"
ErrorCode$(1109)= "UNABLE TO UNLOAD MEDIA"
ErrorCode$(1110)= "MEDIA CHANGED"
ErrorCode$(1111)= "BUS RESET"
ErrorCode$(1112)= "NO MEDIA IN DRIVE"
ErrorCode$(1113)= "NO UNICODE TRANSLATION"
ErrorCode$(1114)= "DLL INIT FAILED"
ErrorCode$(1115)= "SHUTDOWN IN PROGRESS"
ErrorCode$(1116)= "NO SHUTDOWN IN PROGRESS"
ErrorCode$(1117)= "IO DEVICE"
ErrorCode$(1118)= "SERIAL NO DEVICE"
ErrorCode$(1119)= "IRQ BUSY"
ErrorCode$(1120)= "MORE WRITES"
ErrorCode$(1121)= "COUNTER TIMEOUT"
ErrorCode$(1122)= "FLOPPY ID MARK NOT FOUND"
ErrorCode$(1123)= "FLOPPY WRONG CYLINDER"
ErrorCode$(1124)= "FLOPPY UNKNOWN ERROR"
ErrorCode$(1125)= "FLOPPY BAD REGISTERS"
ErrorCode$(1126)= "DISK RECALIBRATE FAILED"
ErrorCode$(1127)= "DISK OPERATION FAILED"
ErrorCode$(1128)= "DISK RESET FAILED"
ErrorCode$(1129)= "EOM OVERFLOW"
ErrorCode$(1130)= "NOT ENOUGH SERVER MEMORY"
ErrorCode$(1131)= "POSSIBLE DEADLOCK"
ErrorCode$(1132)= "MAPPED ALIGNMENT"
ErrorCode$(2202)= "BAD USERNAME"
ErrorCode$(2250)= "NOT CONNECTED"
ErrorCode$(2401)= "OPEN FILES"
ErrorCode$(2404)= "DEVICE IN USE"
ErrorCode$(1200)= "BAD DEVICE"
ErrorCode$(1201)= "CONNECTION UNAVAIL"
ErrorCode$(1202)= "DEVICE ALREADY REMEMBERED"
ErrorCode$(1203)= "NO NET OR BAD PATH"
ErrorCode$(1204)= "BAD PROVIDER"
ErrorCode$(1205)= "CANNOT OPEN PROFILE"
ErrorCode$(1206)= "BAD PROFILE"
ErrorCode$(1207)= "NOT CONTAINER"
ErrorCode$(1208)= "EXTENDED ERROR"
ErrorCode$(1209)= "INVALID GROUPNAME"
ErrorCode$(1210)= "INVALID COMPUTERNAME"
ErrorCode$(1211)= "INVALID EVENTNAME"
ErrorCode$(1212)= "INVALID DOMAINNAME"
ErrorCode$(1213)= "INVALID SERVICENAME"
ErrorCode$(1214)= "INVALID NETNAME"
ErrorCode$(1215)= "INVALID SHARENAME"
ErrorCode$(1216)= "INVALID PASSWORDNAME"
ErrorCode$(1217)= "INVALID MESSAGENAME"
ErrorCode$(1218)= "INVALID MESSAGEDEST"
ErrorCode$(1219)= "SESSION CREDENTIAL CONFLICT"
ErrorCode$(1220)= "REMOTE SESSION LIMIT EXCEEDED"
ErrorCode$(1221)= "DUP DOMAINNAME"
ErrorCode$(1222)= "NO NETWORK"
ErrorCode$(1300)= "NOT ALL ASSIGNED"
ErrorCode$(1301)= "SOME NOT MAPPED"
ErrorCode$(1302)= "NO QUOTAS FOR ACCOUNT"
ErrorCode$(1303)= "LOCAL USER SESSION KEY"
ErrorCode$(1304)= "NULL LM PASSWORD"
ErrorCode$(1305)= "UNKNOWN REVISION"
ErrorCode$(1306)= "REVISION MISMATCH"
ErrorCode$(1307)= "INVALID OWNER"
ErrorCode$(1308)= "INVALID PRIMARY GROUP"
ErrorCode$(1309)= "NO IMPERSONATION TOKEN"
ErrorCode$(1310)= "CANT DISABLE MANDATORY"
ErrorCode$(1311)= "NO LOGON SERVERS"
ErrorCode$(1312)= "NO SUCH LOGON SESSION"
ErrorCode$(1313)= "NO SUCH PRIVILEGE"
ErrorCode$(1314)= "PRIVILEGE NOT HELD"
ErrorCode$(1315)= "INVALID ACCOUNT NAME"
ErrorCode$(1316)= "USER EXISTS"
ErrorCode$(1317)= "NO SUCH USER"
ErrorCode$(1318)= "GROUP EXISTS"
ErrorCode$(1319)= "NO SUCH GROUP"
ErrorCode$(1320)= "MEMBER IN GROUP"
ErrorCode$(1321)= "MEMBER NOT IN GROUP"
ErrorCode$(1322)= "LAST ADMIN"
ErrorCode$(1323)= "WRONG PASSWORD"
ErrorCode$(1324)= "ILL FORMED PASSWORD"
ErrorCode$(1325)= "PASSWORD RESTRICTION"
ErrorCode$(1326)= "LOGON FAILURE"
ErrorCode$(1327)= "ACCOUNT RESTRICTION"
ErrorCode$(1328)= "INVALID LOGON HOURS"
ErrorCode$(1329)= "INVALID WORKSTATION"
ErrorCode$(1330)= "PASSWORD EXPIRED"
ErrorCode$(1331)= "ACCOUNT DISABLED"
ErrorCode$(1332)= "NONE MAPPED"
ErrorCode$(1333)= "TOO MANY LUIDS REQUESTED"
ErrorCode$(1334)= "LUIDS EXHAUSTED"
ErrorCode$(1335)= "INVALID SUB AUTHORITY"
ErrorCode$(1336)= "INVALID ACL"
ErrorCode$(1337)= "INVALID SID"
ErrorCode$(1338)= "INVALID SECURITY DESCR"
ErrorCode$(1340)= "BAD INHERITANCE ACL"
ErrorCode$(1341)= "SERVER DISABLED"
ErrorCode$(1342)= "SERVER NOT DISABLED"
ErrorCode$(1343)= "INVALID ID AUTHORITY"
ErrorCode$(1344)= "ALLOTTED SPACE EXCEEDED"
ErrorCode$(1345)= "INVALID GROUP ATTRIBUTES"
ErrorCode$(1346)= "BAD IMPERSONATION LEVEL"
ErrorCode$(1347)= "CANT OPEN ANONYMOUS"
ErrorCode$(1348)= "BAD VALIDATION CLASS"
ErrorCode$(1349)= "BAD TOKEN TYPE"
ErrorCode$(1350)= "NO SECURITY ON OBJECT"
ErrorCode$(1351)= "CANT ACCESS DOMAIN INFO"
ErrorCode$(1352)= "INVALID SERVER STATE"
ErrorCode$(1353)= "INVALID DOMAIN STATE"
ErrorCode$(1354)= "INVALID DOMAIN ROLE"
ErrorCode$(1355)= "NO SUCH DOMAIN"
ErrorCode$(1356)= "DOMAIN EXISTS"
ErrorCode$(1357)= "DOMAIN LIMIT EXCEEDED"
ErrorCode$(1358)= "INTERNAL DB CORRUPTION"
ErrorCode$(1359)= "INTERNAL ERROR"
ErrorCode$(1360)= "GENERIC NOT MAPPED"
ErrorCode$(1361)= "BAD DESCRIPTOR FORMAT"
ErrorCode$(1362)= "NOT LOGON PROCESS"
ErrorCode$(1363)= "LOGON SESSION EXISTS"
ErrorCode$(1364)= "NO SUCH PACKAGE"
ErrorCode$(1365)= "BAD LOGON SESSION STATE"
ErrorCode$(1366)= "LOGON SESSION COLLISION"
ErrorCode$(1367)= "INVALID LOGON TYPE"
ErrorCode$(1368)= "CANNOT IMPERSONATE"
ErrorCode$(1369)= "RXACT INVALID STATE"
ErrorCode$(1370)= "RXACT COMMIT FAILURE"
ErrorCode$(1371)= "SPECIAL ACCOUNT"
ErrorCode$(1372)= "SPECIAL GROUP"
ErrorCode$(1373)= "SPECIAL USER"
ErrorCode$(1374)= "MEMBERS PRIMARY GROUP"
ErrorCode$(1375)= "TOKEN ALREADY IN USE"
ErrorCode$(1376)= "NO SUCH ALIAS"
ErrorCode$(1377)= "MEMBER NOT IN ALIAS"
ErrorCode$(1378)= "MEMBER IN ALIAS"
ErrorCode$(1379)= "ALIAS EXISTS"
ErrorCode$(1380)= "LOGON NOT GRANTED"
ErrorCode$(1381)= "TOO MANY SECRETS"
ErrorCode$(1382)= "SECRET TOO LONG"
ErrorCode$(1383)= "INTERNAL DB ERROR"
ErrorCode$(1384)= "TOO MANY CONTEXT IDS"
ErrorCode$(1385)= "LOGON TYPE NOT GRANTED"
ErrorCode$(1386)= "NT CROSS ENCRYPTION REQUIRED"
ErrorCode$(1387)= "NO SUCH MEMBER"
ErrorCode$(1388)= "INVALID MEMBER"
ErrorCode$(1389)= "TOO MANY SIDS"
ErrorCode$(1390)= "LM CROSS ENCRYPTION REQUIRED"
ErrorCode$(1391)= "NO INHERITANCE"
ErrorCode$(1392)= "FILE CORRUPT"
ErrorCode$(1393)= "DISK CORRUPT"
ErrorCode$(1394)= "NO USER SESSION KEY"
ErrorCode$(1400)= "INVALID WINDOW HANDLE"
ErrorCode$(1401)= "INVALID MENU HANDLE"
ErrorCode$(1402)= "INVALID CURSOR HANDLE"
ErrorCode$(1403)= "INVALID ACCEL HANDLE"
ErrorCode$(1404)= "INVALID HOOK HANDLE"
ErrorCode$(1405)= "INVALID DWP HANDLE"
ErrorCode$(1406)= "TLW WITH WSCHILD"
ErrorCode$(1407)= "CANNOT FIND WND CLASS"
ErrorCode$(1408)= "WINDOW OF OTHER THREAD"
ErrorCode$(1409)= "HOTKEY ALREADY REGISTERED"
ErrorCode$(1410)= "CLASS ALREADY EXISTS"
ErrorCode$(1411)= "CLASS DOES NOT EXIST"
ErrorCode$(1412)= "CLASS HAS WINDOWS"
ErrorCode$(1413)= "INVALID INDEX"
ErrorCode$(1414)= "INVALID ICON HANDLE"
ErrorCode$(1415)= "PRIVATE DIALOG INDEX"
ErrorCode$(1416)= "LISTBOX ID NOT FOUND"
ErrorCode$(1417)= "NO WILDCARD CHARACTERS"
ErrorCode$(1418)= "CLIPBOARD NOT OPEN"
ErrorCode$(1419)= "HOTKEY NOT REGISTERED"
ErrorCode$(1420)= "WINDOW NOT DIALOG"
ErrorCode$(1421)= "CONTROL ID NOT FOUND"
ErrorCode$(1422)= "INVALID COMBOBOX MESSAGE"
ErrorCode$(1423)= "WINDOW NOT COMBOBOX"
ErrorCode$(1424)= "INVALID EDIT HEIGHT"
ErrorCode$(1425)= "DC NOT FOUND"
ErrorCode$(1426)= "INVALID HOOK FILTER"
ErrorCode$(1427)= "INVALID FILTER PROC"
ErrorCode$(1428)= "HOOK NEEDS HMOD"
ErrorCode$(1429)= "GLOBAL ONLY HOOK"
ErrorCode$(1430)= "JOURNAL HOOK SET"
ErrorCode$(1431)= "HOOK NOT INSTALLED"
ErrorCode$(1432)= "INVALID LB MESSAGE"
ErrorCode$(1433)= "SETCOUNT ON BAD LB"
ErrorCode$(1434)= "LB WITHOUT TABSTOPS"
ErrorCode$(1435)= "DESTROY OBJECT OF OTHER THREAD"
ErrorCode$(1436)= "CHILD WINDOW MENU"
ErrorCode$(1437)= "NO SYSTEM MENU"
ErrorCode$(1438)= "INVALID MSGBOX STYLE"
ErrorCode$(1439)= "INVALID SPI VALUE"
ErrorCode$(1440)= "SCREEN ALREADY LOCKED"
ErrorCode$(1441)= "HWNDS HAVE DIFF PARENT"
ErrorCode$(1442)= "NOT CHILD WINDOW"
ErrorCode$(1443)= "INVALID GW COMMAND"
ErrorCode$(1444)= "INVALID THREAD ID"
ErrorCode$(1445)= "NON MDICHILD WINDOW"
ErrorCode$(1446)= "POPUP ALREADY ACTIVE"
ErrorCode$(1447)= "NO SCROLLBARS"
ErrorCode$(1448)= "INVALID SCROLLBAR RANGE"
ErrorCode$(1449)= "INVALID SHOWWIN COMMAND"
ErrorCode$(1500)= "EVENTLOG FILE CORRUPT"
ErrorCode$(1501)= "EVENTLOG CANT START"
ErrorCode$(1502)= "LOG FILE FULL"
ErrorCode$(1503)= "EVENTLOG FILE CHANGED"
ErrorCode$(1700)= "RPC S INVALID STRING BINDING"
ErrorCode$(1701)= "RPC S WRONG KIND OF BINDING"
ErrorCode$(1702)= "RPC S INVALID BINDING"
ErrorCode$(1703)= "RPC S PROTSEQ NOT SUPPORTED"
ErrorCode$(1704)= "RPC S INVALID RPC PROTSEQ"
ErrorCode$(1705)= "RPC S INVALID STRING UUID"
ErrorCode$(1706)= "RPC S INVALID ENDPOINT FORMAT"
ErrorCode$(1707)= "RPC S INVALID NET ADDR"
ErrorCode$(1708)= "RPC S NO ENDPOINT FOUND"
ErrorCode$(1709)= "RPC S INVALID TIMEOUT"
ErrorCode$(1710)= "RPC S OBJECT NOT FOUND"
ErrorCode$(1711)= "RPC S ALREADY REGISTERED"
ErrorCode$(1712)= "RPC S TYPE ALREADY REGISTERED"
ErrorCode$(1713)= "RPC S ALREADY LISTENING"
ErrorCode$(1714)= "RPC S NO PROTSEQS REGISTERED"
ErrorCode$(1715)= "RPC S NOT LISTENING"
ErrorCode$(1716)= "RPC S UNKNOWN MGR TYPE"
ErrorCode$(1717)= "RPC S UNKNOWN IF"
ErrorCode$(1718)= "RPC S NO BINDINGS"
ErrorCode$(1719)= "RPC S NO PROTSEQS"
ErrorCode$(1720)= "RPC S CANT CREATE ENDPOINT"
ErrorCode$(1721)= "RPC S OUT OF RESOURCES"
ErrorCode$(1722)= "RPC S SERVER UNAVAILABLE"
ErrorCode$(1723)= "RPC S SERVER TOO BUSY"
ErrorCode$(1724)= "RPC S INVALID NETWORK OPTIONS"
ErrorCode$(1725)= "RPC S NO CALL ACTIVE"
ErrorCode$(1726)= "RPC S CALL FAILED"
ErrorCode$(1727)= "RPC S CALL FAILED DNE"
ErrorCode$(1728)= "RPC S PROTOCOL ERROR"
ErrorCode$(1730)= "RPC S UNSUPPORTED TRANS SYN"
ErrorCode$(1732)= "RPC S UNSUPPORTED TYPE"
ErrorCode$(1733)= "RPC S INVALID TAG"
ErrorCode$(1734)= "RPC S INVALID BOUND"
ErrorCode$(1735)= "RPC S NO ENTRY NAME"
ErrorCode$(1736)= "RPC S INVALID NAME SYNTAX"
ErrorCode$(1737)= "RPC S UNSUPPORTED NAME SYNTAX"
ErrorCode$(1739)= "RPC S UUID NO ADDRESS"
ErrorCode$(1740)= "RPC S DUPLICATE ENDPOINT"
ErrorCode$(1741)= "RPC S UNKNOWN AUTHN TYPE"
ErrorCode$(1742)= "RPC S MAX CALLS TOO SMALL"
ErrorCode$(1743)= "RPC S STRING TOO LONG"
ErrorCode$(1744)= "RPC S PROTSEQ NOT FOUND"
ErrorCode$(1745)= "RPC S PROCNUM OUT OF RANGE"
ErrorCode$(1746)= "RPC S BINDING HAS NO AUTH"
ErrorCode$(1747)= "RPC S UNKNOWN AUTHN SERVICE"
ErrorCode$(1748)= "RPC S UNKNOWN AUTHN LEVEL"
ErrorCode$(1749)= "RPC S INVALID AUTH IDENTITY"
ErrorCode$(1750)= "RPC S UNKNOWN AUTHZ SERVICE"
ErrorCode$(1751)= "EPT S INVALID ENTRY"
ErrorCode$(1752)= "EPT S CANT PERFORM OP"
ErrorCode$(1753)= "EPT S NOT REGISTERED"
ErrorCode$(1754)= "RPC S NOTHING TO EXPORT"
ErrorCode$(1755)= "RPC S INCOMPLETE NAME"
ErrorCode$(1756)= "RPC S INVALID VERS OPTION"
ErrorCode$(1757)= "RPC S NO MORE MEMBERS"
ErrorCode$(1758)= "RPC S NOT ALL OBJS UNEXPORTED"
ErrorCode$(1759)= "RPC S INTERFACE NOT FOUND"
ErrorCode$(1760)= "RPC S ENTRY ALREADY EXISTS"
ErrorCode$(1761)= "RPC S ENTRY NOT FOUND"
ErrorCode$(1762)= "RPC S NAME SERVICE UNAVAILABLE"
ErrorCode$(1763)= "RPC S INVALID NAF ID"
ErrorCode$(1764)= "RPC S CANNOT SUPPORT"
ErrorCode$(1765)= "RPC S NO CONTEXT AVAILABLE"
ErrorCode$(1766)= "RPC S INTERNAL ERROR"
ErrorCode$(1767)= "RPC S ZERO DIVIDE"
ErrorCode$(1768)= "RPC S ADDRESS ERROR"
ErrorCode$(1769)= "RPC S FP DIV ZERO"
ErrorCode$(1770)= "RPC S FP UNDERFLOW"
ErrorCode$(1771)= "RPC S FP OVERFLOW"
ErrorCode$(1772)= "RPC X NO MORE ENTRIES"
ErrorCode$(1773)= "RPC X SS CHAR TRANS OPEN FAIL"
ErrorCode$(1774)= "RPC X SS CHAR TRANS SHORT FILE"
ErrorCode$(1775)= "RPC X SS IN NULL CONTEXT"
ErrorCode$(1777)= "RPC X SS CONTEXT DAMAGED"
ErrorCode$(1778)= "RPC X SS HANDLES MISMATCH"
ErrorCode$(1779)= "RPC X SS CANNOT GET CALL HANDLE"
ErrorCode$(1780)= "RPC X NULL REF POINTER"
ErrorCode$(1781)= "RPC X ENUM VALUE OUT OF RANGE"
ErrorCode$(1782)= "RPC X BYTE COUNT TOO SMALL"
ErrorCode$(1783)= "RPC X BAD STUB DATA"
ErrorCode$(1784)= "INVALID USER BUFFER"
ErrorCode$(1785)= "UNRECOGNIZED MEDIA"
ErrorCode$(1786)= "NO TRUST LSA SECRET"
ErrorCode$(1787)= "NO TRUST SAM ACCOUNT"
ErrorCode$(1788)= "TRUSTED DOMAIN FAILURE"
ErrorCode$(1789)= "TRUSTED RELATIONSHIP FAILURE"
ErrorCode$(1790)= "TRUST FAILURE"
ErrorCode$(1791)= "RPC S CALL IN PROGRESS"
ErrorCode$(1792)= "NETLOGON NOT STARTED"
ErrorCode$(1793)= "ACCOUNT EXPIRED"
ErrorCode$(1794)= "REDIRECTOR HAS OPEN HANDLES"
ErrorCode$(1795)= "PRINTER DRIVER ALREADY INSTALLED"
ErrorCode$(1796)= "UNKNOWN PORT"
ErrorCode$(1797)= "UNKNOWN PRINTER DRIVER"
ErrorCode$(1798)= "UNKNOWN PRINTPROCESSOR"
ErrorCode$(1799)= "INVALID SEPARATOR FILE"
ErrorCode$(1800)= "INVALID PRIORITY"
ErrorCode$(1801)= "INVALID PRINTER NAME"
ErrorCode$(1802)= "PRINTER ALREADY EXISTS"
ErrorCode$(1803)= "INVALID PRINTER COMMAND"
ErrorCode$(1804)= "INVALID DATATYPE"
ErrorCode$(1805)= "INVALID ENVIRONMENT"
ErrorCode$(1806)= "RPC S NO MORE BINDINGS"
ErrorCode$(1807)= "NOLOGON INTERDOMAIN TRUST ACCOUNT"
ErrorCode$(1808)= "NOLOGON WORKSTATION TRUST ACCOUNT"
ErrorCode$(1809)= "NOLOGON SERVER TRUST ACCOUNT"
ErrorCode$(1810)= "DOMAIN TRUST INCONSISTENT"
ErrorCode$(1811)= "SERVER HAS OPEN HANDLES"
ErrorCode$(1812)= "RESOURCE DATA NOT FOUND"
ErrorCode$(1813)= "RESOURCE TYPE NOT FOUND"
ErrorCode$(1814)= "RESOURCE NAME NOT FOUND"
ErrorCode$(1815)= "RESOURCE LANG NOT FOUND"
ErrorCode$(1816)= "NOT ENOUGH QUOTA"
ErrorCode$(1898)= "RPC S GROUP MEMBER NOT FOUND"
ErrorCode$(1899)= "EPT S CANT CREATE"
ErrorCode$(1900)= "RPC S INVALID OBJECT"
ErrorCode$(1901)= "INVALID TIME"
ErrorCode$(1902)= "INVALID FORM NAME"
ErrorCode$(1903)= "INVALID FORM SIZE"
ErrorCode$(1904)= "ALREADY WAITING"
ErrorCode$(1905)= "PRINTER DELETED"
ErrorCode$(1906)= "INVALID PRINTER STATE"
ErrorCode$(6118)= "NO BROWSER SERVERS FOUND"
msgbox(GetErrorCode$(9999))

WinTask - FindExecutable

'
' FindExectuable
'
' Author: Joe Strazzere
'
' "shell32.dll" Alias "FindExecutableA"
' (ByVal lpFile As String,
'  ByVal lpDirectory As String,
'  ByVal lpResult As String) As Long
'
Function FindExecutable$(File$)
  Local Exe$
  Local ret
  Exe$="                                                                                 "
  ret=External("shell32.dll", "FindExecutableA", File$, "", Exe$)
  If ret>32 then
   FindExecutable$=Exe$
  else
   FindExecutable$="NOT FOUND - Return code is "+Str$(ret)
  endif
EndFunction
MyFile$="d:wwf.doc"
Msgbox("The .exe that opens "+MyFile$+" is : "+FindExecutable$(MyFile$))

WinTask - EncryptFile

'
' EncryptFile
'
' Author: Joe Strazzere
'
Dim memptr as unsigned
Function EncryptFile(file$)
 EncryptFile = External("ADVAPI32.dll","EncryptFileA", file$)
EndFunction
Function DecryptFile(file$)
 DecryptFile = External("ADVAPI32.dll","DecryptFileA", file$, 0)
EndFunction
'memptr=Allocate(64)
'ret=PokeString(memptr,"c:SuppressionTest.txt",0)

ret=EncryptFile("c:JoeShareA.txt")
msgbox(ret)
'ret=DecryptFile("SuppressionTest.txt")
'msgbox(ret)

WinTask - Win32 API ErrorCodes

'
' Win32 API Error Codes
'
' Author: Joe Strazzere
'

NO_ERROR = 0
ERROR_SUCCESS = 0
ERROR_INVALID_FUNCTION = 1
ERROR_FILE_NOT_FOUND = 2
ERROR_PATH_NOT_FOUND = 3
ERROR_TOO_MANY_OPEN_FILES = 4
ERROR_ACCESS_DENIED = 5
ERROR_INVALID_HANDLE = 6
ERROR_ARENA_TRASHED = 7
ERROR_NOT_ENOUGH_MEMORY = 8
ERROR_INVALID_BLOCK = 9
ERROR_BAD_ENVIRONMENT = 10
ERROR_BAD_FORMAT = 11
ERROR_INVALID_ACCESS = 12
ERROR_INVALID_DATA = 13
ERROR_OUTOFMEMORY = 14
ERROR_INVALID_DRIVE = 15
ERROR_CURRENT_DIRECTORY = 16
ERROR_NOT_SAME_DEVICE = 17
ERROR_NO_MORE_FILES = 18
ERROR_WRITE_PROTECT = 19
ERROR_BAD_UNIT = 20
ERROR_NOT_READY = 21
ERROR_BAD_COMMAND = 22
ERROR_CRC = 23
ERROR_BAD_LENGTH = 24
ERROR_SEEK = 25
ERROR_NOT_DOS_DISK = 26
ERROR_SECTOR_NOT_FOUND = 27
ERROR_OUT_OF_PAPER = 28
ERROR_WRITE_FAULT = 29
ERROR_READ_FAULT = 30
ERROR_GEN_FAILURE = 31
ERROR_SHARING_VIOLATION = 32
ERROR_LOCK_VIOLATION = 33
ERROR_WRONG_DISK = 34
ERROR_SHARING_BUFFER_EXCEEDED = 36
ERROR_HANDLE_EOF = 38
ERROR_HANDLE_DISK_FULL = 39
ERROR_NOT_SUPPORTED = 50
ERROR_REM_NOT_LIST = 51
ERROR_DUP_NAME = 52
ERROR_BAD_NETPATH = 53
ERROR_NETWORK_BUSY = 54
ERROR_DEV_NOT_EXIST = 55
ERROR_TOO_MANY_CMDS = 56
ERROR_ADAP_HDW_ERR = 57
ERROR_BAD_NET_RESP = 58
ERROR_UNEXP_NET_ERR = 59
ERROR_BAD_REM_ADAP = 60
ERROR_PRINTQ_FULL = 61
ERROR_NO_SPOOL_SPACE = 62
ERROR_PRINT_CANCELLED = 63
ERROR_NETNAME_DELETED = 64
ERROR_NETWORK_ACCESS_DENIED = 65
ERROR_BAD_DEV_TYPE = 66
ERROR_BAD_NET_NAME = 67
ERROR_TOO_MANY_NAMES = 68
ERROR_TOO_MANY_SESS = 69
ERROR_SHARING_PAUSED = 70
ERROR_REQ_NOT_ACCEP = 71
ERROR_REDIR_PAUSED = 72
ERROR_FILE_EXISTS = 80
ERROR_CANNOT_MAKE = 82
ERROR_FAIL_I24 = 83
ERROR_OUT_OF_STRUCTURES = 84
ERROR_ALREADY_ASSIGNED = 85
ERROR_INVALID_PASSWORD = 86
ERROR_INVALID_PARAMETER = 87
ERROR_NET_WRITE_FAULT = 88
ERROR_NO_PROC_SLOTS = 89
ERROR_TOO_MANY_SEMAPHORES = 100
ERROR_EXCL_SEM_ALREADY_OWNED = 101
ERROR_SEM_IS_SET = 102
ERROR_TOO_MANY_SEM_REQUESTS = 103
ERROR_INVALID_AT_INTERRUPT_TIME = 104
ERROR_SEM_OWNER_DIED = 105
ERROR_SEM_USER_LIMIT = 106
ERROR_DISK_CHANGE = 107
ERROR_DRIVE_LOCKED = 108
ERROR_BROKEN_PIPE = 109
ERROR_OPEN_FAILED = 110
ERROR_BUFFER_OVERFLOW = 111
ERROR_DISK_FULL = 112
ERROR_NO_MORE_SEARCH_HANDLES = 113
ERROR_INVALID_TARGET_HANDLE = 114
ERROR_INVALID_CATEGORY = 117
ERROR_INVALID_VERIFY_SWITCH = 118
ERROR_BAD_DRIVER_LEVEL = 119
ERROR_CALL_NOT_IMPLEMENTED = 120
ERROR_SEM_TIMEOUT = 121
ERROR_INSUFFICIENT_BUFFER = 122
ERROR_INVALID_NAME = 123
ERROR_INVALID_LEVEL = 124
ERROR_NO_VOLUME_LABEL = 125
ERROR_MOD_NOT_FOUND = 126
ERROR_PROC_NOT_FOUND = 127
ERROR_WAIT_NO_CHILDREN = 128
ERROR_CHILD_NOT_COMPLETE = 129
ERROR_DIRECT_ACCESS_HANDLE = 130
ERROR_NEGATIVE_SEEK = 131
ERROR_SEEK_ON_DEVICE = 132
ERROR_IS_JOIN_TARGET = 133
ERROR_IS_JOINED = 134
ERROR_IS_SUBSTED = 135
ERROR_NOT_JOINED = 136
ERROR_NOT_SUBSTED = 137
ERROR_JOIN_TO_JOIN = 138
ERROR_SUBST_TO_SUBST = 139
ERROR_JOIN_TO_SUBST = 140
ERROR_SUBST_TO_JOIN = 141
ERROR_BUSY_DRIVE = 142
ERROR_SAME_DRIVE = 143
ERROR_DIR_NOT_ROOT = 144
ERROR_DIR_NOT_EMPTY = 145
ERROR_IS_SUBST_PATH = 146
ERROR_IS_JOIN_PATH = 147
ERROR_PATH_BUSY = 148
ERROR_IS_SUBST_TARGET = 149
ERROR_SYSTEM_TRACE = 150
ERROR_INVALID_EVENT_COUNT = 151
ERROR_TOO_MANY_MUXWAITERS = 152
ERROR_INVALID_LIST_FORMAT = 153
ERROR_LABEL_TOO_LONG = 154
ERROR_TOO_MANY_TCBS = 155
ERROR_SIGNAL_REFUSED = 156
ERROR_DISCARDED = 157
ERROR_NOT_LOCKED = 158
ERROR_BAD_THREADID_ADDR = 159
ERROR_BAD_ARGUMENTS = 160
ERROR_BAD_PATHNAME = 161
ERROR_SIGNAL_PENDING = 162
ERROR_MAX_THRDS_REACHED = 164
ERROR_LOCK_FAILED = 167
ERROR_BUSY = 170
ERROR_CANCEL_VIOLATION = 173
ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 174
ERROR_INVALID_SEGMENT_NUMBER = 180
ERROR_INVALID_ORDINAL = 182
ERROR_ALREADY_EXISTS = 183
ERROR_INVALID_FLAG_NUMBER = 186
ERROR_SEM_NOT_FOUND = 187
ERROR_INVALID_STARTING_CODESEG = 188
ERROR_INVALID_STACKSEG = 189
ERROR_INVALID_MODULETYPE = 190
ERROR_INVALID_EXE_SIGNATURE = 191
ERROR_EXE_MARKED_INVALID = 192
ERROR_BAD_EXE_FORMAT = 193
ERROR_ITERATED_DATA_EXCEEDS_64k = 194
ERROR_INVALID_MINALLOCSIZE = 195
ERROR_DYNLINK_FROM_INVALID_RING = 196
ERROR_IOPL_NOT_ENABLED = 197
ERROR_INVALID_SEGDPL = 198
ERROR_AUTODATASEG_EXCEEDS_64k = 199
ERROR_RING2SEG_MUST_BE_MOVABLE = 200
ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 201
ERROR_INFLOOP_IN_RELOC_CHAIN = 202
ERROR_ENVVAR_NOT_FOUND = 203
ERROR_NO_SIGNAL_SENT = 205
ERROR_FILENAME_EXCED_RANGE = 206
ERROR_RING2_STACK_IN_USE = 207
ERROR_META_EXPANSION_TOO_LONG = 208
ERROR_INVALID_SIGNAL_NUMBER = 209
ERROR_THREAD_1_INACTIVE = 210
ERROR_LOCKED = 212
ERROR_TOO_MANY_MODULES = 214
ERROR_NESTING_NOT_ALLOWED = 215
ERROR_BAD_PIPE = 230
ERROR_PIPE_BUSY = 231
ERROR_NO_DATA = 232
ERROR_PIPE_NOT_CONNECTED = 233
ERROR_MORE_DATA = 234 ' dderror
ERROR_VC_DISCONNECTED = 240
ERROR_INVALID_EA_NAME = 254
ERROR_EA_LIST_INCONSISTENT = 255
ERROR_NO_MORE_ITEMS = 259
ERROR_CANNOT_COPY = 266
ERROR_DIRECTORY = 267
ERROR_EAS_DIDNT_FIT = 275
ERROR_EA_FILE_CORRUPT = 276
ERROR_EA_TABLE_FULL = 277
ERROR_INVALID_EA_HANDLE = 278
ERROR_EAS_NOT_SUPPORTED = 282
ERROR_NOT_OWNER = 288
ERROR_TOO_MANY_POSTS = 298
ERROR_MR_MID_NOT_FOUND = 317
ERROR_INVALID_ADDRESS = 487
ERROR_ARITHMETIC_OVERFLOW = 534
ERROR_PIPE_CONNECTED = 535
ERROR_PIPE_LISTENING = 536
ERROR_EA_ACCESS_DENIED = 994
ERROR_OPERATION_ABORTED = 995
ERROR_IO_INCOMPLETE = 996
ERROR_IO_PENDING = 997 ' dderror
ERROR_NOACCESS = 998
ERROR_SWAPERROR = 999
ERROR_STACK_OVERFLOW = 1001
ERROR_INVALID_MESSAGE = 1002
ERROR_CAN_NOT_COMPLETE = 1003
ERROR_INVALID_FLAGS = 1004
ERROR_UNRECOGNIZED_VOLUME = 1005
ERROR_FILE_INVALID = 1006
ERROR_FULLSCREEN_MODE = 1007
ERROR_NO_TOKEN = 1008
ERROR_BADDB = 1009
ERROR_BADKEY = 1010
ERROR_CANTOPEN = 1011
ERROR_CANTREAD = 1012
ERROR_CANTWRITE = 1013
ERROR_REGISTRY_RECOVERED = 1014
ERROR_REGISTRY_CORRUPT = 1015
ERROR_REGISTRY_IO_FAILED = 1016
ERROR_NOT_REGISTRY_FILE = 1017
ERROR_KEY_DELETED = 1018
ERROR_NO_LOG_SPACE = 1019
ERROR_KEY_HAS_CHILDREN = 1020
ERROR_CHILD_MUST_BE_VOLATILE = 1021
ERROR_NOTIFY_ENUM_DIR = 1022
ERROR_DEPENDENT_SERVICES_RUNNING = 1051
ERROR_INVALID_SERVICE_CONTROL = 1052
ERROR_SERVICE_REQUEST_TIMEOUT = 1053
ERROR_SERVICE_NO_THREAD = 1054
ERROR_SERVICE_DATABASE_LOCKED = 1055
ERROR_SERVICE_ALREADY_RUNNING = 1056
ERROR_INVALID_SERVICE_ACCOUNT = 1057
ERROR_SERVICE_DISABLED = 1058
ERROR_CIRCULAR_DEPENDENCY = 1059
ERROR_SERVICE_DOES_NOT_EXIST = 1060
ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061
ERROR_SERVICE_NOT_ACTIVE = 1062
ERROR_FAILED_SERVICE_CONTROLLER_CONNECT = 1063
ERROR_EXCEPTION_IN_SERVICE = 1064
ERROR_DATABASE_DOES_NOT_EXIST = 1065
ERROR_SERVICE_SPECIFIC_ERROR = 1066
ERROR_PROCESS_ABORTED = 1067
ERROR_SERVICE_DEPENDENCY_FAIL = 1068
ERROR_SERVICE_LOGON_FAILED = 1069
ERROR_SERVICE_START_HANG = 1070
ERROR_INVALID_SERVICE_LOCK = 1071
ERROR_SERVICE_MARKED_FOR_DELETE = 1072
ERROR_SERVICE_EXISTS = 1073
ERROR_ALREADY_RUNNING_LKG = 1074
ERROR_SERVICE_DEPENDENCY_DELETED = 1075
ERROR_BOOT_ALREADY_ACCEPTED = 1076
ERROR_SERVICE_NEVER_STARTED = 1077
ERROR_DUPLICATE_SERVICE_NAME = 1078
ERROR_END_OF_MEDIA = 1100
ERROR_FILEMARK_DETECTED = 1101
ERROR_BEGINNING_OF_MEDIA = 1102
ERROR_SETMARK_DETECTED = 1103
ERROR_NO_DATA_DETECTED = 1104
ERROR_PARTITION_FAILURE = 1105
ERROR_INVALID_BLOCK_LENGTH = 1106
ERROR_DEVICE_NOT_PARTITIONED = 1107
ERROR_UNABLE_TO_LOCK_MEDIA = 1108
ERROR_UNABLE_TO_UNLOAD_MEDIA = 1109
ERROR_MEDIA_CHANGED = 1110
ERROR_BUS_RESET = 1111
ERROR_NO_MEDIA_IN_DRIVE = 1112
ERROR_NO_UNICODE_TRANSLATION = 1113
ERROR_DLL_INIT_FAILED = 1114
ERROR_SHUTDOWN_IN_PROGRESS = 1115
ERROR_NO_SHUTDOWN_IN_PROGRESS = 1116
ERROR_IO_DEVICE = 1117
ERROR_SERIAL_NO_DEVICE = 1118
ERROR_IRQ_BUSY = 1119
ERROR_MORE_WRITES = 1120
ERROR_COUNTER_TIMEOUT = 1121
ERROR_FLOPPY_ID_MARK_NOT_FOUND = 1122
ERROR_FLOPPY_WRONG_CYLINDER = 1123
ERROR_FLOPPY_UNKNOWN_ERROR = 1124
ERROR_FLOPPY_BAD_REGISTERS = 1125
ERROR_DISK_RECALIBRATE_FAILED = 1126
ERROR_DISK_OPERATION_FAILED = 1127
ERROR_DISK_RESET_FAILED = 1128
ERROR_EOM_OVERFLOW = 1129
ERROR_NOT_ENOUGH_SERVER_MEMORY = 1130
ERROR_POSSIBLE_DEADLOCK = 1131
ERROR_MAPPED_ALIGNMENT = 1132
ERROR_BAD_USERNAME = 2202
ERROR_NOT_CONNECTED = 2250
ERROR_OPEN_FILES = 2401
ERROR_DEVICE_IN_USE = 2404
ERROR_BAD_DEVICE = 1200
ERROR_CONNECTION_UNAVAIL = 1201
ERROR_DEVICE_ALREADY_REMEMBERED = 1202
ERROR_NO_NET_OR_BAD_PATH = 1203
ERROR_BAD_PROVIDER = 1204
ERROR_CANNOT_OPEN_PROFILE = 1205
ERROR_BAD_PROFILE = 1206
ERROR_NOT_CONTAINER = 1207
ERROR_EXTENDED_ERROR = 1208
ERROR_INVALID_GROUPNAME = 1209
ERROR_INVALID_COMPUTERNAME = 1210
ERROR_INVALID_EVENTNAME = 1211
ERROR_INVALID_DOMAINNAME = 1212
ERROR_INVALID_SERVICENAME = 1213
ERROR_INVALID_NETNAME = 1214
ERROR_INVALID_SHARENAME = 1215
ERROR_INVALID_PASSWORDNAME = 1216
ERROR_INVALID_MESSAGENAME = 1217
ERROR_INVALID_MESSAGEDEST = 1218
ERROR_SESSION_CREDENTIAL_CONFLICT = 1219
ERROR_REMOTE_SESSION_LIMIT_EXCEEDED = 1220
ERROR_DUP_DOMAINNAME = 1221
ERROR_NO_NETWORK = 1222
ERROR_NOT_ALL_ASSIGNED = 1300
ERROR_SOME_NOT_MAPPED = 1301
ERROR_NO_QUOTAS_FOR_ACCOUNT = 1302
ERROR_LOCAL_USER_SESSION_KEY = 1303
ERROR_NULL_LM_PASSWORD = 1304
ERROR_UNKNOWN_REVISION = 1305
ERROR_REVISION_MISMATCH = 1306
ERROR_INVALID_OWNER = 1307
ERROR_INVALID_PRIMARY_GROUP = 1308
ERROR_NO_IMPERSONATION_TOKEN = 1309
ERROR_CANT_DISABLE_MANDATORY = 1310
ERROR_NO_LOGON_SERVERS = 1311
ERROR_NO_SUCH_LOGON_SESSION = 1312
ERROR_NO_SUCH_PRIVILEGE = 1313
ERROR_PRIVILEGE_NOT_HELD = 1314
ERROR_INVALID_ACCOUNT_NAME = 1315
ERROR_USER_EXISTS = 1316
ERROR_NO_SUCH_USER = 1317
ERROR_GROUP_EXISTS = 1318
ERROR_NO_SUCH_GROUP = 1319
ERROR_MEMBER_IN_GROUP = 1320
ERROR_MEMBER_NOT_IN_GROUP = 1321
ERROR_LAST_ADMIN = 1322
ERROR_WRONG_PASSWORD = 1323
ERROR_ILL_FORMED_PASSWORD = 1324
ERROR_PASSWORD_RESTRICTION = 1325
ERROR_LOGON_FAILURE = 1326
ERROR_ACCOUNT_RESTRICTION = 1327
ERROR_INVALID_LOGON_HOURS = 1328
ERROR_INVALID_WORKSTATION = 1329
ERROR_PASSWORD_EXPIRED = 1330
ERROR_ACCOUNT_DISABLED = 1331
ERROR_NONE_MAPPED = 1332
ERROR_TOO_MANY_LUIDS_REQUESTED = 1333
ERROR_LUIDS_EXHAUSTED = 1334
ERROR_INVALID_SUB_AUTHORITY = 1335
ERROR_INVALID_ACL = 1336
ERROR_INVALID_SID = 1337
ERROR_INVALID_SECURITY_DESCR = 1338
ERROR_BAD_INHERITANCE_ACL = 1340
ERROR_SERVER_DISABLED = 1341
ERROR_SERVER_NOT_DISABLED = 1342
ERROR_INVALID_ID_AUTHORITY = 1343
ERROR_ALLOTTED_SPACE_EXCEEDED = 1344
ERROR_INVALID_GROUP_ATTRIBUTES = 1345
ERROR_BAD_IMPERSONATION_LEVEL = 1346
ERROR_CANT_OPEN_ANONYMOUS = 1347
ERROR_BAD_VALIDATION_CLASS = 1348
ERROR_BAD_TOKEN_TYPE = 1349
ERROR_NO_SECURITY_ON_OBJECT = 1350
ERROR_CANT_ACCESS_DOMAIN_INFO = 1351
ERROR_INVALID_SERVER_STATE = 1352
ERROR_INVALID_DOMAIN_STATE = 1353
ERROR_INVALID_DOMAIN_ROLE = 1354
ERROR_NO_SUCH_DOMAIN = 1355
ERROR_DOMAIN_EXISTS = 1356
ERROR_DOMAIN_LIMIT_EXCEEDED = 1357
ERROR_INTERNAL_DB_CORRUPTION = 1358
ERROR_INTERNAL_ERROR = 1359
ERROR_GENERIC_NOT_MAPPED = 1360
ERROR_BAD_DESCRIPTOR_FORMAT = 1361
ERROR_NOT_LOGON_PROCESS = 1362
ERROR_LOGON_SESSION_EXISTS = 1363
ERROR_NO_SUCH_PACKAGE = 1364
ERROR_BAD_LOGON_SESSION_STATE = 1365
ERROR_LOGON_SESSION_COLLISION = 1366
ERROR_INVALID_LOGON_TYPE = 1367
ERROR_CANNOT_IMPERSONATE = 1368
ERROR_RXACT_INVALID_STATE = 1369
ERROR_RXACT_COMMIT_FAILURE = 1370
ERROR_SPECIAL_ACCOUNT = 1371
ERROR_SPECIAL_GROUP = 1372
ERROR_SPECIAL_USER = 1373
ERROR_MEMBERS_PRIMARY_GROUP = 1374
ERROR_TOKEN_ALREADY_IN_USE = 1375
ERROR_NO_SUCH_ALIAS = 1376
ERROR_MEMBER_NOT_IN_ALIAS = 1377
ERROR_MEMBER_IN_ALIAS = 1378
ERROR_ALIAS_EXISTS = 1379
ERROR_LOGON_NOT_GRANTED = 1380
ERROR_TOO_MANY_SECRETS = 1381
ERROR_SECRET_TOO_LONG = 1382
ERROR_INTERNAL_DB_ERROR = 1383
ERROR_TOO_MANY_CONTEXT_IDS = 1384
ERROR_LOGON_TYPE_NOT_GRANTED = 1385
ERROR_NT_CROSS_ENCRYPTION_REQUIRED = 1386
ERROR_NO_SUCH_MEMBER = 1387
ERROR_INVALID_MEMBER = 1388
ERROR_TOO_MANY_SIDS = 1389
ERROR_LM_CROSS_ENCRYPTION_REQUIRED = 1390
ERROR_NO_INHERITANCE = 1391
ERROR_FILE_CORRUPT = 1392
ERROR_DISK_CORRUPT = 1393
ERROR_NO_USER_SESSION_KEY = 1394
ERROR_INVALID_WINDOW_HANDLE = 1400
ERROR_INVALID_MENU_HANDLE = 1401
ERROR_INVALID_CURSOR_HANDLE = 1402
ERROR_INVALID_ACCEL_HANDLE = 1403
ERROR_INVALID_HOOK_HANDLE = 1404
ERROR_INVALID_DWP_HANDLE = 1405
ERROR_TLW_WITH_WSCHILD = 1406
ERROR_CANNOT_FIND_WND_CLASS = 1407
ERROR_WINDOW_OF_OTHER_THREAD = 1408
ERROR_HOTKEY_ALREADY_REGISTERED = 1409
ERROR_CLASS_ALREADY_EXISTS = 1410
ERROR_CLASS_DOES_NOT_EXIST = 1411
ERROR_CLASS_HAS_WINDOWS = 1412
ERROR_INVALID_INDEX = 1413
ERROR_INVALID_ICON_HANDLE = 1414
ERROR_PRIVATE_DIALOG_INDEX = 1415
ERROR_LISTBOX_ID_NOT_FOUND = 1416
ERROR_NO_WILDCARD_CHARACTERS = 1417
ERROR_CLIPBOARD_NOT_OPEN = 1418
ERROR_HOTKEY_NOT_REGISTERED = 1419
ERROR_WINDOW_NOT_DIALOG = 1420
ERROR_CONTROL_ID_NOT_FOUND = 1421
ERROR_INVALID_COMBOBOX_MESSAGE = 1422
ERROR_WINDOW_NOT_COMBOBOX = 1423
ERROR_INVALID_EDIT_HEIGHT = 1424
ERROR_DC_NOT_FOUND = 1425
ERROR_INVALID_HOOK_FILTER = 1426
ERROR_INVALID_FILTER_PROC = 1427
ERROR_HOOK_NEEDS_HMOD = 1428
ERROR_GLOBAL_ONLY_HOOK = 1429
ERROR_JOURNAL_HOOK_SET = 1430
ERROR_HOOK_NOT_INSTALLED = 1431
ERROR_INVALID_LB_MESSAGE = 1432
ERROR_SETCOUNT_ON_BAD_LB = 1433
ERROR_LB_WITHOUT_TABSTOPS = 1434
ERROR_DESTROY_OBJECT_OF_OTHER_THREAD = 1435
ERROR_CHILD_WINDOW_MENU = 1436
ERROR_NO_SYSTEM_MENU = 1437
ERROR_INVALID_MSGBOX_STYLE = 1438
ERROR_INVALID_SPI_VALUE = 1439
ERROR_SCREEN_ALREADY_LOCKED = 1440
ERROR_HWNDS_HAVE_DIFF_PARENT = 1441
ERROR_NOT_CHILD_WINDOW = 1442
ERROR_INVALID_GW_COMMAND = 1443
ERROR_INVALID_THREAD_ID = 1444
ERROR_NON_MDICHILD_WINDOW = 1445
ERROR_POPUP_ALREADY_ACTIVE = 1446
ERROR_NO_SCROLLBARS = 1447
ERROR_INVALID_SCROLLBAR_RANGE = 1448
ERROR_INVALID_SHOWWIN_COMMAND = 1449
ERROR_EVENTLOG_FILE_CORRUPT = 1500
ERROR_EVENTLOG_CANT_START = 1501
ERROR_LOG_FILE_FULL = 1502
ERROR_EVENTLOG_FILE_CHANGED = 1503
RPC_S_INVALID_STRING_BINDING = 1700
RPC_S_WRONG_KIND_OF_BINDING = 1701
RPC_S_INVALID_BINDING = 1702
RPC_S_PROTSEQ_NOT_SUPPORTED = 1703
RPC_S_INVALID_RPC_PROTSEQ = 1704
RPC_S_INVALID_STRING_UUID = 1705
RPC_S_INVALID_ENDPOINT_FORMAT = 1706
RPC_S_INVALID_NET_ADDR = 1707
RPC_S_NO_ENDPOINT_FOUND = 1708
RPC_S_INVALID_TIMEOUT = 1709
RPC_S_OBJECT_NOT_FOUND = 1710
RPC_S_ALREADY_REGISTERED = 1711
RPC_S_TYPE_ALREADY_REGISTERED = 1712
RPC_S_ALREADY_LISTENING = 1713
RPC_S_NO_PROTSEQS_REGISTERED = 1714
RPC_S_NOT_LISTENING = 1715
RPC_S_UNKNOWN_MGR_TYPE = 1716
RPC_S_UNKNOWN_IF = 1717
RPC_S_NO_BINDINGS = 1718
RPC_S_NO_PROTSEQS = 1719
RPC_S_CANT_CREATE_ENDPOINT = 1720
RPC_S_OUT_OF_RESOURCES = 1721
RPC_S_SERVER_UNAVAILABLE = 1722
RPC_S_SERVER_TOO_BUSY = 1723
RPC_S_INVALID_NETWORK_OPTIONS = 1724
RPC_S_NO_CALL_ACTIVE = 1725
RPC_S_CALL_FAILED = 1726
RPC_S_CALL_FAILED_DNE = 1727
RPC_S_PROTOCOL_ERROR = 1728
RPC_S_UNSUPPORTED_TRANS_SYN = 1730
RPC_S_UNSUPPORTED_TYPE = 1732
RPC_S_INVALID_TAG = 1733
RPC_S_INVALID_BOUND = 1734
RPC_S_NO_ENTRY_NAME = 1735
RPC_S_INVALID_NAME_SYNTAX = 1736
RPC_S_UNSUPPORTED_NAME_SYNTAX = 1737
RPC_S_UUID_NO_ADDRESS = 1739
RPC_S_DUPLICATE_ENDPOINT = 1740
RPC_S_UNKNOWN_AUTHN_TYPE = 1741
RPC_S_MAX_CALLS_TOO_SMALL = 1742
RPC_S_STRING_TOO_LONG = 1743
RPC_S_PROTSEQ_NOT_FOUND = 1744
RPC_S_PROCNUM_OUT_OF_RANGE = 1745
RPC_S_BINDING_HAS_NO_AUTH = 1746
RPC_S_UNKNOWN_AUTHN_SERVICE = 1747
RPC_S_UNKNOWN_AUTHN_LEVEL = 1748
RPC_S_INVALID_AUTH_IDENTITY = 1749
RPC_S_UNKNOWN_AUTHZ_SERVICE = 1750
EPT_S_INVALID_ENTRY = 1751
EPT_S_CANT_PERFORM_OP = 1752
EPT_S_NOT_REGISTERED = 1753
RPC_S_NOTHING_TO_EXPORT = 1754
RPC_S_INCOMPLETE_NAME = 1755
RPC_S_INVALID_VERS_OPTION = 1756
RPC_S_NO_MORE_MEMBERS = 1757
RPC_S_NOT_ALL_OBJS_UNEXPORTED = 1758
RPC_S_INTERFACE_NOT_FOUND = 1759
RPC_S_ENTRY_ALREADY_EXISTS = 1760
RPC_S_ENTRY_NOT_FOUND = 1761
RPC_S_NAME_SERVICE_UNAVAILABLE = 1762
RPC_S_INVALID_NAF_ID = 1763
RPC_S_CANNOT_SUPPORT = 1764
RPC_S_NO_CONTEXT_AVAILABLE = 1765
RPC_S_INTERNAL_ERROR = 1766
RPC_S_ZERO_DIVIDE = 1767
RPC_S_ADDRESS_ERROR = 1768
RPC_S_FP_DIV_ZERO = 1769
RPC_S_FP_UNDERFLOW = 1770
RPC_S_FP_OVERFLOW = 1771
RPC_X_NO_MORE_ENTRIES = 1772
RPC_X_SS_CHAR_TRANS_OPEN_FAIL = 1773
RPC_X_SS_CHAR_TRANS_SHORT_FILE = 1774
RPC_X_SS_IN_NULL_CONTEXT = 1775
RPC_X_SS_CONTEXT_DAMAGED = 1777
RPC_X_SS_HANDLES_MISMATCH = 1778
RPC_X_SS_CANNOT_GET_CALL_HANDLE = 1779
RPC_X_NULL_REF_POINTER = 1780
RPC_X_ENUM_VALUE_OUT_OF_RANGE = 1781
RPC_X_BYTE_COUNT_TOO_SMALL = 1782
RPC_X_BAD_STUB_DATA = 1783
ERROR_INVALID_USER_BUFFER = 1784
ERROR_UNRECOGNIZED_MEDIA = 1785
ERROR_NO_TRUST_LSA_SECRET = 1786
ERROR_NO_TRUST_SAM_ACCOUNT = 1787
ERROR_TRUSTED_DOMAIN_FAILURE = 1788
ERROR_TRUSTED_RELATIONSHIP_FAILURE = 1789
ERROR_TRUST_FAILURE = 1790
RPC_S_CALL_IN_PROGRESS = 1791
ERROR_NETLOGON_NOT_STARTED = 1792
ERROR_ACCOUNT_EXPIRED = 1793
ERROR_REDIRECTOR_HAS_OPEN_HANDLES = 1794
ERROR_PRINTER_DRIVER_ALREADY_INSTALLED = 1795
ERROR_UNKNOWN_PORT = 1796
ERROR_UNKNOWN_PRINTER_DRIVER = 1797
ERROR_UNKNOWN_PRINTPROCESSOR = 1798
ERROR_INVALID_SEPARATOR_FILE = 1799
ERROR_INVALID_PRIORITY = 1800
ERROR_INVALID_PRINTER_NAME = 1801
ERROR_PRINTER_ALREADY_EXISTS = 1802
ERROR_INVALID_PRINTER_COMMAND = 1803
ERROR_INVALID_DATATYPE = 1804
ERROR_INVALID_ENVIRONMENT = 1805
RPC_S_NO_MORE_BINDINGS = 1806
ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 1807
ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 1808
ERROR_NOLOGON_SERVER_TRUST_ACCOUNT = 1809
ERROR_DOMAIN_TRUST_INCONSISTENT = 1810
ERROR_SERVER_HAS_OPEN_HANDLES = 1811
ERROR_RESOURCE_DATA_NOT_FOUND = 1812
ERROR_RESOURCE_TYPE_NOT_FOUND = 1813
ERROR_RESOURCE_NAME_NOT_FOUND = 1814
ERROR_RESOURCE_LANG_NOT_FOUND = 1815
ERROR_NOT_ENOUGH_QUOTA = 1816
RPC_S_GROUP_MEMBER_NOT_FOUND = 1898
EPT_S_CANT_CREATE = 1899
RPC_S_INVALID_OBJECT = 1900
ERROR_INVALID_TIME = 1901
ERROR_INVALID_FORM_NAME = 1902
ERROR_INVALID_FORM_SIZE = 1903
ERROR_ALREADY_WAITING = 1904
ERROR_PRINTER_DELETED = 1905
ERROR_INVALID_PRINTER_STATE = 1906
ERROR_NO_BROWSER_SERVERS_FOUND = 6118

WinTask - EnvVars

'
' EnvVars
'
' Author: Joe Strazzere
'

'var$=Envir$(<var_name$>)

AppData$  = Envir$("APPDATA")
ComputerName$ = Envir$("COMPUTERNAME")
HomeDrive$  = Envir$("HOMEDRIVE")
HomePath$  = Envir$("HOMEPATH")
OS$    = Envir$("OS")
SystemDrive$ = Envir$("SYSTEMDRIVE")
Temp$   = Envir$("TEMP")
Tmp$   = Envir$("TMP")
UserDomain$  = Envir$("USERDOMAIN")
UserName$  = Envir$("USERNAME")

msgbox(Temp$)

WinTask - EnvExpand

'
' EnvExpand
'
' Author: Joe Strazzere
'

' This script expands a string containing an environment variable
' (that is, enclosed in %...%).
' It may also be useful when expanding strings stored in the Registry
'
dim ptr1 as unsigned
dim ptr2 as unsigned
EnvString$="%INCLUDE%"
ptr1=allocate(10)
PokeString(ptr1,EnvString$,1)
ptr2=allocate(255)
ret=External("kernel32.dll","ExpandEnvironmentStringsA",ptr1,ptr2,100)
var$=PeekString$(ptr2)
msgbox(EnvString$+" expands to: "+var$)

WinTask - DownloadFile$

'
' DownloadFile$ - Download HTML from a URL in the background and put it in a string variable
'
' Author: Joe Strazzere
'

Function DownloadFile$(URL$)
    Local ReturnedString$
    Local TempString$
 Local TempFile$

 TempFile$="c:jsstemp.txt"

    If Exist(TempFile$) then
      Kill(TempFile$)
    End If

    Write(TempFile$, "URL not found!")

    External("urlmon.dll", "URLDownloadToFileA", 0, URL$, TempFile$, 0, 0)

    SetReadPos(TempFile$,0)
    TempString$=""

    Repeat
      Read(TempFile$, ReturnedString$)
     TempString$ = TempString$ + ReturnedString$
    Until EOF(TempFile$)

    DownloadFile$ = TempString$
EndFunction

'
' try it
'
var$=DownloadFile$("http://www.google.com/intl/en/about.html")
msgbox(var$)

WinTask - DrawText

'
' DrawText
'
' Draw some text on the Desktop
'
' Author: Joe Strazzere
'

dim ptr as unsigned
dim ptr2 as unsigned
ptr=allocate(16)
ptr2=ptr+0
pokeinteger(ptr2,0,4)
ptr2=ptr+4
pokeinteger(ptr2,0,4)
ptr2=ptr+8
pokeinteger(ptr2,640,4)
ptr2=ptr+12
pokeinteger(ptr2,32,4)
hdc=External("gdi32","CreateDCA","DISPLAY",0,0,0)
'Private Type RECT
'    Left As Long
'    Top As Long
'    Right As Long
'    Bottom As Long
'End Type
'Flag:
'    0 = left
'    1 = center
'    2 = right
mytext$="This is a test"
External("user32","DrawTextA",hdc, mytext$,len(mytext$),ptr,0)
   
External("gdi32","DeleteDC")

WinTask - DoFileDownload

'
' DoFileDownload
'
' Author: Joe Strazzere
'
'Private Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long
'Private Sub Form_Load()
'    'KPD-Team 2000
'    'URL: http://www.allapi.net/
'    'E-Mail: KPDTeam@Allapi.net
'   DoFileDownload StrConv("http://www.allapi.net/", vbUnicode)
'End Sub

Dim memptr as unsigned
Function DoFileDownload(memptr)
 DoFileDownload = External("shdocvw.dll","DoFileDownload", memptr)
EndFunction

memptr=allocate(64)
ret=PokeString(memptr,"c:\JSSTest.txt",0)
ret=DoFileDownload(memptr)
msgbox(ret)

WinTask - DiskCopy

'
' Diskcopy - launch DiskCopy applet (for diskettes only)
'
' Author: Joe Strazzere
'

'rundll32.exe diskcopy.dll,DiskCopyRunDll
Shell ("rundll32.exe diskcopy.dll,DiskCopyRunDll") 

WinTask - DeclareHTML

'
' DeclareHTML
'
' Author: Joe Strazzere
'

nbsp$=  " "
quot$=  Chr$(34)
amp$=  "&"
lt$=  "<"
gtz$=  ">"
copy$=  "©"
reg$=  "®"
tm$=  "™"
acute$=  "´"
laquo$=  "«"
raquo$=  "»"
iexcl$=  "¡"
iquest$= "¿"
CAPagrave$= "À"
agrave$= "à"
CAPaacute$= "Á"
aacute$= "á"
CAPacirc$= "Â"
acirc$=  "â"
CAPatilde$= "Ã"
atilde$= "ã"
CAPauml$= "Ä"
auml$=  "ä"
CAParing$= "Å"
aring$=  "å"
CAPaelig$= "Æ"
aelig$=  "æ"
CAPccedil$= "Ç"
ccedil$= "ç"
CAPeth$= "Ð"
eth$=  "ð"
CAPegrave$= "È"
egrave$= "è"
CAPeacute$= "É"
eacute$= "é"
CAPecirc$= "Ê"
ecirc$=  "ê"
CAPeuml$= "Ë"
euml$=  "ë"
CAPigrave$= "Ì"
igrave$= "ì"
CAPiacute$= "Í"
iacute$= "í"
CAPicirc$= "Î"
icirc$=  "î"
CAPiuml$= "Ï"
iuml$=  "ï"
CAPntilde$= "Ñ"
ntilde$= "ñ"
CAPograve$= "Ò"
ograve$= "ò"
CAPoacute$= "Ó"
oacute$= "ó"
CAPocirc$= "Ô"
ocirc$=  "ô"
CAPotilde$= "Õ"
otilde$= "õ"
CAPouml$= "Ö"
ouml$=  "ö"
CAPoslash$= "Ø"
oslash$= "ø"
CAPugrave$= "Ù"
ugrave$= "ù"
CAPuacute$= "Ú"
uacute$= "ú"
CAPucirc$= "Û"
ucirc$=  "û"
CAPuuml$= "Ü"
uuml$=  "ü"
CAPyacute$= "Ý"
uacute$= "ý"
yuml$=  "ÿ"
thorn$=  "Þ"
szlig$=  "ß"
sect$=  "§"
para$=  "¶"
micro$=  "µ"
brvbar$= "¦"
plusmn$= "±"
middot$= "·"
uml$=  "¨"
cedil$=  "¸"
ordf$=  "ª"
ordm$=  "º"
not$=  "¬"
shy$=  "­"
macr$=  "¯"
deg$=  "°"
sup1$=  "¹"
sup2$=  "²"
sup3$=  "³"
frac14$= "¼"
frac12$= "½"
frac34$= "¾"
times$=  "×"
divid$=  "÷"
cent$=  "¢"
pound$=  "£"
curren$= "¤"
yen$=  "¥"

WinTask - DeclareConstants

'
' Declare ASCII Control Code Constants
'
' Author: Joe Strazzere
'

Const_NUL$ = Chr$(0) ' Null
Const_SOH$ = Chr$(1) ' Start of Heading
Const_STX$ = Chr$(2) ' Start of Text
Const_ETX$ = Chr$(3) ' End of Text
Const_EOT$ = Chr$(4) ' End of Transmission
Const_ENQ$ = Chr$(5) ' Enquiry
Const_ACK$ = Chr$(6)  ' Acknowledgement
Const_BEL$ = Chr$(7) ' Bell
Const_BKSP$ = Chr$(8) ' Backspace
Const_TAB$ = Chr$(9) ' Horizontal Tab
Const_LF$ = Chr$(10) ' Line Feed (or New Line)
Const_VT$ = Chr$(11) ' Vertical Tab
Const_FF$ = Chr$(12) ' Form Feed (or New Page)
Const_CR$ = Chr$(13) ' Carriage Return
Const_SO$ = Chr$(14) ' Shift Out
Const_SI$ = Chr$(15) ' Shift In
Const_SLE$ = Chr$(16)
Const_CS1$ = Chr$(17)
Const_DC2$ = Chr$(18) ' Device Control 2
Const_DC3$ = Chr$(19) ' Device Control 3
Const_DC4$ = Chr$(20) ' Device Control 4
Const_NAK$ = Chr$(21) ' Negative Acknowledgement
Const_SYN$ = Chr$(22) ' Synchronous Idle
Const_ETB$ = Chr$(23) ' End of Transmission Block
Const_CAN$ = Chr$(24) ' Cancel
Const_EM$ = Chr$(25) ' End of Medium
Const_SIB$ = Chr$(26)
Const_ESC$ = Chr$(27) ' Escape
Const_FS$ = Chr$(28) ' File Separator
Const_GS$ = Chr$(29) ' Group Separator
Const_RS$ = Chr$(30) ' Record Separator
Const_US$ = Chr$(31) ' Unit Separator
Const_DEL$ = Chr$(127)
Const_CrLf$ = Chr$(13)+Chr$(10) ' Carriage Return, Line Feed