|
-
Aug 23rd, 2000, 09:50 AM
#1
Code:
'does a file exist?
Private Declare Function SHFileExists Lib "shell32" Alias "#45" (ByVal szPath As String) As Long
Private Sub Form_Load()
MsgBox "Does the file exist?" + Str$(SHFileExists("c:\autoexec.bat"))
End Sub
Code:
'format a drive
Const SHFD_CAPACITY_DEFAULT = 0 ' default drive capacity
Const SHFD_CAPACITY_360 = 3 ' 360KB, applies to 5.25" drives only
Const SHFD_CAPACITY_720 = 5 ' 720KB, applies to 3.5" drives only
Const SHFD_FORMAT_QUICK = 0 ' quick format
Const SHFD_FORMAT_FULL = 1 ' full format
Const SHFD_FORMAT_SYSONLY = 2 ' copies system files only (Win95 Only!)
Private Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long
Private Sub Form_Load()
'iDrive = The drive number to format. Drive A=0, B=1 (if present, otherwise C=1), and so on.
SHFormatDrive Me.hwnd, 0, SHFD_CAPACITY_DEFAULT, SHFD_FORMAT_QUICK
End Sub
Code:
'change windows password
Private Declare Function PwdChangePassword Lib "mpr" Alias "PwdChangePasswordA" (ByVal lpcRegkeyname As String, ByVal hwnd As Long, ByVal uiReserved1 As Long, ByVal uiReserved2 As Long) As Long
Private Sub Form_Load()
PwdChangePassword "SCRSAVE", Me.hwnd, 0, 0
End Sub
Code:
'flash a window more than once
Const FLASHW_STOP = 0 'Stop flashing. The system restores the window to its original state.
Const FLASHW_CAPTION = &H1 'Flash the window caption.
Const FLASHW_TRAY = &H2 'Flash the taskbar button.
Const FLASHW_ALL = (FLASHW_CAPTION Or FLASHW_TRAY) 'Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION Or FLASHW_TRAY flags.
Const FLASHW_TIMER = &H4 'Flash continuously, until the FLASHW_STOP flag is set.
Const FLASHW_TIMERNOFG = &HC 'Flash continuously until the window comes to the foreground.
Private Type FLASHWINFO
cbSize As Long
hwnd As Long
dwFlags As Long
uCount As Long
dwTimeout As Long
End Type
Private Declare Function FlashWindowEx Lib "user32" (pfwi As FLASHWINFO) As Boolean
Private Sub Form_Load()
Dim FlashInfo As FLASHWINFO
'Specifies the size of the structure.
FlashInfo.cbSize = Len(FlashInfo)
'Specifies the flash status
FlashInfo.dwFlags = FLASHW_ALL Or FLASHW_TIMER
'Specifies the rate, in milliseconds, at which the window will be flashed. If dwTimeout is zero, the function uses the default cursor blink rate.
FlashInfo.dwTimeout = 0
'Handle to the window to be flashed. The window can be either opened or minimized.
FlashInfo.hwnd = Me.hwnd
'Specifies the number of times to flash the window.
FlashInfo.uCount = 0
FlashWindowEx FlashInfo
End Sub
Private Sub Form_Paint()
Me.CurrentX = 0
Me.CurrentY = 0
Me.Print "Click me !"
End Sub
those are the only good ones I found, if anybody has any other ones they would like to share, post them, Please!
-
Aug 23rd, 2000, 10:04 AM
#2
Fanatic Member
A while ago, there was a post just like this one. And someone spoke about a site with a lot of undocumented api's.
This is the url: http://www.geocities.com/SiliconValley/4942/index.html
-
Aug 23rd, 2000, 11:14 AM
#3
I have that place bookmarked in 3 different folders in my favorite places 
but that is more of a C++ site.....
and this is a VB Forum...(well this one right here(general vb QA)
-
Aug 23rd, 2000, 12:01 PM
#4
There was a topic about this awhile ago. It's in the API forum.
-
Aug 23rd, 2000, 03:55 PM
#5
Hyperactive Member
is it possible that these api's are not documented because some of them do not appear to work under NT 4.0?
I am so skeptical, I can hardly believe it!
PS I am not a 'hyperactive member' I am a cool, calm, and collected member 
-
Aug 23rd, 2000, 04:18 PM
#6
I think the reason lots of them are undocumented is because they are, for whatever reason, not acceptable i.e:
consume too much resources or they have been supersended by another function. Have any of you Non-C++ programmers
heard of _hread or _lopen?
Another reason that some believe is that Microsoft wants to hide them from the public! lol.
-
Aug 23rd, 2000, 11:26 PM
#7
well, All api's are documented, just not publicly 
it would be stupid to add a hidden function, and not even write the declaration down.... hehehe.....
-
Aug 24th, 2000, 05:18 AM
#8
Fanatic Member
Has Microsoft released the source code of Windows to the public?
-
Aug 24th, 2000, 08:09 AM
#9
Not yet. There should have been a headline (or some advertisement) on their website to let people know that it's up.
Dennis: Actually, not all of them are documented. Some people have to dig deep into the dll files to extract the functions.
-
Aug 24th, 2000, 08:09 AM
#10
Hyperactive Member
oetje:
which version of windows are you referring to?
I am so skeptical, I can hardly believe it!
PS I am not a 'hyperactive member' I am a cool, calm, and collected member 
-
Aug 24th, 2000, 09:34 AM
#11
Megatron, you mean M$ put functions in the dll's and didnt even document the declaration??
-
Aug 24th, 2000, 11:08 AM
#12
Yes. They, of course, have a documentation of it, but do not release some of them.
-
Aug 24th, 2000, 11:27 AM
#13
thats what I meant, MS has all of them documented, thats why I said "not publicly" because it is not available to the public, just MS.
-
Aug 24th, 2000, 01:08 PM
#14
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|