|
|||
|
SwfKit PRO 2 has new Object is DLL , it power when use call API function , i want more sample about it , i used APIView to get function of API , but it help for VB , can you help me change to SWFKit to use
Thank a lot |
|
|||
|
Thank admin , some function i need use with SWFKit PRO
(some function had support by SWFkit but i want know how use it by DLL Object) ExitWindowsEx Function Declare Function ExitWindowsEx Lib "user32.dll" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long //////////////// ExtractIcon Function Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst as Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long Platforms Windows 95: Supported. Windows 98: Supported. Windows NT: Requires Windows NT 3.1 or later. Windows 2000: Supported. Windows CE: Not Supported. Description & Usage ExtractIcon extracts a single icon from a file. This file can be an executable (.exe) file, a dynamic link library (.dll), or an icon file (.ico). Alternately, this function can also determine how many icons are stored in such a file. The icon generated by this function must be destroyed using DestroyIcon after the program has finished using it. Return Value If the function failed because the specified file was not found, the function returns 1. If the function failed because the icon requested by the function did not exist, the function returns 0. If the function succeeded and the number of icons in the file was requested, the function returns the number of icons stored in the file. If the function succeeded and an icon was specified, the function returns a handle to the extracted icon. ///////////// Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long // Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long // Declare Function SystemTimeToFileTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME, lpFileTime As FILETIME) As Long |
|
|||
|
if anyone want know more API function please download APIView from microsoft or download this ebook in my host
Visual_Basic_Windows_API_Programming http://flashvn.homeip.net/download/a...rogramming.chm |
|
|||
|
ExtractIcon
Code:
Dll.registerFunction(
"shell32.dll", //library name
"ExtractIconA", // function name
"extractIcon", //alias in SWFKit
"stdcall",//call type
"long",//return type
"long", //param 1
"string", //param 2
"long", //param 3
);
var path = Shell.getSpecialFolder("system") + "\\shell32.dll";
var count = extractIcon(0, path, -1);
trace(count);
|
|
|||
|
SystemTimeToFileTime
Code:
/*
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;
*/
var PStructSYSTEMTIME = new DllParam(
16,// size
1// 1 - byref, 0 - byval
);
/*
typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, *PFILETIME;
*/
var PStructFILETIME = new DllParam(8, 1);
Dll.registerFunction("kernel32.dll", "GetSystemTime", "getSysTime", "stdcall",
"void", PStructSYSTEMTIME);
Dll.registerFunction("Kernel32.dll", "SystemTimeToFileTime", "getFileTime", "stdcall",
"long", PStructSYSTEMTIME, PStructFILETIME);
//using StringStream object to pass a pointer
function SystemTime()
{
var i;
this.value = new StringStream;
function getValue()
{
var arr = [];
var i;
this.value.getPos = 0;
for (i = 0; i < 8; i++)
{
arr[i] = this.value.getShort();
}
return arr;
}
function wYear()
{
return this.getValue()[0];
}
function wMonth()
{
return this.getValue()[1];
}
function wDayofWeek()
{
return this.getValue()[2];
}
function wDay()
{
return this.getValue()[3];
}
function wHour()
{
return this.getValue()[4];
}
function wMinute()
{
return this.getValue()[5];
}
function wSecond()
{
return this.getValue()[6];
}
function wMilliseconds()
{
return this.getValue()[7];
}
// Allocating 16 bytes in the StringStream.
for (i = 0; i < 16; i++) this.value.put('0');
}
var time = new SystemTime();
getSysTime(time);
trace(time.wYear());
trace(time.wMonth());
trace(time.wDay());
trace(time.wDayofWeek());
trace(time.wHour());
trace(time.wMinute());
trace(time.wSecond());
trace(time.wMilliseconds());
function FileTime()
{
var i;
this.value = new StringStream;
for (i = 0; i < 8; i++) this.value.put('0');
function getValue()
{
var arr = [];
var i;
this.value.getPos = 0;
for (i = 0; i < 2; i++)
{
arr[i] = this.value.getLong();
}
return arr;
}
function low()
{
return this.getValue()[0];
}
function high()
{
return this.getValue()[1];
}
}
var fileTime = new FileTime();
if (getFileTime(time, fileTime))
{
trace(fileTime.low());
trace(fileTime.high());
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|