Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2004, 08:26 AM
Junior Member
 
Join Date: Apr 2004
Posts: 9
Default Hell about Dll

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
Reply With Quote
  #2 (permalink)  
Old 04-30-2004, 09:02 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Hell about Dll

Yes, please list the API functions at here, we will show you how to call them in SWFKit.
Reply With Quote
  #3 (permalink)  
Old 04-30-2004, 09:52 AM
Junior Member
 
Join Date: Apr 2004
Posts: 9
Default Re:Hell about Dll

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
Reply With Quote
  #4 (permalink)  
Old 04-30-2004, 10:00 AM
Junior Member
 
Join Date: Apr 2004
Posts: 9
Default Re:Hell about Dll

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
Reply With Quote
  #5 (permalink)  
Old 04-30-2004, 10:36 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Hell about Dll

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);
Reply With Quote
  #6 (permalink)  
Old 04-30-2004, 11:07 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Hell about Dll

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());
}
Reply With Quote
  #7 (permalink)  
Old 04-30-2004, 11:27 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Hell about Dll

Convert the file time to Date object
Code:
var t = fileTime.low() + (fileTime.high() << 32);
t = t / 10000 + Date.UTC(1601, 1, 1);
trace(new Date(t));
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:11 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.