Click to See Complete Forum and Search --> : required winapi32 description


ryan chan
June 1st, 1999, 11:00 PM
Where or how to i get a description of the winapi32 for VB.

Thanks!

Ravi Kiran
June 2nd, 1999, 12:04 AM
You could use the API loaded that comes with VB.
It can also be accessed from start->prog.. menu.
or locate Apiload.exe under VB's inst. folder

There is also a type library for all WinAPIs. I dont know where to get it from. Also, i am told, there are more troubles with this Typelib than API loader's declarations.

Ravi

ryan chan
June 2nd, 1999, 12:43 AM
the api viewer does not tell you what does the function do

Ravi Kiran
June 2nd, 1999, 01:11 AM
To know what the Win32 API does, you have to look at MSDN. They are the OS fns, and not VBs, right?
Onsite source : Got to MSDN msdn.microsoft.com then Library->Library Home. Click on Platform SDK and you will find Win32API sectn

Take a look at the opinion expressed by Klaus H. Probst, " Let VB Hook into the OS", at
http://www.vb-zone.com/free/opinion.asp.

ryan chan
June 2nd, 1999, 01:33 AM
thanks alot Ravi Kiran

ryan chan
June 2nd, 1999, 02:48 AM
hi Ravi,
do you know how to use the API function GetSystemTime?

how to i use it? i have tried it but there is an error and i do not know how to solve it

Compile Error:
Variable required - can't assign to this expression


Thanks.

Ravi Kiran
June 2nd, 1999, 03:16 AM
Hi,

You should have incl. your code...
Anyway, this is how i defined and used: (This is as-is from API Viewer)


Type SYSTEMTIME
wYear as Integer
wMonth as Integer
wDayOfWeek as Integer
wDay as Integer
wHour as Integer
wMinute as Integer
wSecond as Integer
wMilliseconds as Integer
End Type
Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime as SYSTEMTIME)


public Sub MySysTime()
Dim tmpSystime as SYSTEMTIME
GetSystemTime tmpSystime
With tmpSystime
Debug.print "System time:(dd/mm/yyyy), day, hh:mm:ss";
Debug.print Str(.wDay) & "/" & Str(.wMonth) & "/" & Str(.wYear);
Debug.print " " & Str(.wDayOfWeek) & ",";
Debug.print Str(.wHour) & ":" & Str(.wMinute) & ":" & Str(.wSecond);
End With
End Sub




and the trace generated is like this:

System Time:(dd/mm/yyyy), day, hh:mm:ss 2/ 6/ 1999 3, 16: 55: 33

which indeed is correct.

Ravi
ps: A WORD (2bytes) in C is an Integer in VB, which is also 2 bytes

ryan chan
June 2nd, 1999, 03:34 AM
thanks Ravi butwhen i tried it the hour seem to be difference from what is expected
that is my computer time is 04:27 and the result i obtained is 08:27
how to i solve this problem?

Ravi Kiran
June 2nd, 1999, 04:06 AM
interesting!!..

But, on my system there is no diff. I just tested again!!

There is another function called GetLocalTime
It also has just the same syntax of GetSystemtime.
and MSDN doesn't say anything about what is the difference between them?

Run both, one after other and check the results!!
On my system, both gave same values.
Ravi

ryan chan
June 2nd, 1999, 04:18 AM
thanks alot Ravi
getlocaltime give me the correct result

Crazy D @ Work
June 2nd, 1999, 09:49 AM
Hi
It sounds like that GetLocaleTime gives you the local time setting (for me, that's Central European Time + 1), and the other one gives you the CET (or maybe it gives you the bios time)


Crazy D :-)