´¿VBÕæÕýʵÏÖÎȶ¨µÄNT·þÎñ
'* ************************************************************** *
'* ³ÌÐòÃû³Æ£ºmodNtSrv
'* ³ÌÐò¹¦ÄÜ£ºÊµÏÖNT·þÎñ
'* ×÷Õߣºlyserver
'* ÁªÏµ·½Ê½£ºhttp://blog.csdn.net/lyserver
'* ************************************************************** *
Option Explicit
'·þÎñ¿ØÖƳ£Á¿
Public Enum SERVICE_CONTROL
SERVICE_CONTROL_STOP = 1&
SERVICE_CONTROL_PAUSE = 2&
SERVICE_CONTROL_CONTINUE = 3&
SERVICE_CONTROL_INTERROGATE = 4&
SERVICE_CONTROL_SHUTDOWN = 5&
End Enum
'·þÎñ״̬³£Á¿
Public Enum SERVICE_STATE
SERVICE_STOPPED = &H1
SERVICE_START_PENDING = &H2
SERVICE_STOP_PENDING = &H3
SERVICE_RUNNING = &H4
SERVICE_CONTINUE_PENDING = &H5
SERVICE_PAUSE_PENDING = &H6
SERVICE_PAUSED = &H7
Delete = &H10000
End Enum
'·þÎñÆô¶¯·½Ê½³£Á¿
Public Const SERVICE_SYSTEM_START As Long = &H1
Public Const SERVICE_AUTO_START As Long = &H2
Public Const SERVICE_DEMAND_START As Long = &H3
'·þÎñ´íÎó¿ØÖƼ¶±ð
Private Const SERVICE_ERROR_NORMAL As Long = &H1
'SCMȨÏÞ³£Á¿
Public Const STANDARD_RIGHTS_REQUIRED = &HF0000
Public Const SC_MANAGER_CONNECT = &H1
Public Const SC_MANAGER_CREATE_SERVICE = &H2
Public Const SC_MANAGER_ENUMERATE_SERVICE = &H4
Public Const SC_MANAGER_LOCK = &H8
Public Const SC_MANAGER_QUERY_LOCK_STATUS = &H10
Public Const SC_MANAGER_MODIFY_BOOT_CONFIG = &H20
Public Const SC_MANAGER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SC_MANAGER_CONNECT Or SC_MANAGER_CREATE_SERVICE Or SC_MANAGER_ENUMERATE_SERVICE Or SC_MANAGER_LOCK Or SC_MANAGER_QUERY_LOCK_STATUS Or SC_MANAGER_MODIFY_BOOT_CONFIG)
'½ÓÊÜSCP¿ØÖÆÏûÏ¢³£Á¿
Public Const SERVICE_ACCEPT_STOP As Long = &H1
Public Const SERVICE_ACCEPT_PAUSE_CONTINUE As Long = &H2
Public Const SERVICE_ACCEPT_SHUTDOWN As Long = &
Ïà¹ØÎĵµ£º
´«Í³·½·¨ÊDZéÀúÒ»±é
Èç¹ûlistbox ÏîÄ¿¹ý¶à
Ã÷ÏÔËٶȲ»ÐÐ
ºÃ·½·¨ÊÇͨ¹ýsendmessge·¢ÏûÏ¢¸ølistboxÈÃËû°ÑÑ¡ÖÐÏîÄ¿Ö±½Ó´«µ½²ÎÊýÊý×éÖÐ
You can use the SendMessage() API function instead.
As
you probably know, this function lets you send a message to one or more
windows. The declaration statement conforms ......
¡¾º¯Êý¡¿
GetFileVersionInfo
¡¾²Ù×÷ϵͳ¡¿
Win9X:Yes
WinNT:Yes
¡¾ÉùÃ÷¡¿
GetFileVersionInfo Lib "version.dll" Alias "GetFileVersionInfoA" &n ......
“×Ô¶¯µã»÷°´Å¥”С¹¤¾ßVBÔ´Âë
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Pri ......
ʹÓÃVC±àдVBʹÓÃDLL
Ò»¡¢ÔÚº¯Êý¶¨ÒåÇ°±ØÐë¼ÓÉÏextern "c"£¬_stdcall¹Ø¼ü×Ö¡£
extern "C" int _stdcall Sum(int x,int y)
{
return x+y;
}
¶þ¡¢DLLµÄ.defÎļþÖбØÐë¼ÓÉÏÈë¿Úº¯Êý
EXPORTS
sample @1
  ......
ÓÐʱ£¬ÎªÁËʵÏÖ¶¯Ì¬¸üУ¬ÎÒÃÇÐèÒª¶ÔÕý´¦ÓÚÔËÐÐ״̬µÄÓ¦ÓóÌÐò½øÐÐ×Ôɾ³ý£¬¾ÍÏñ360°²È«ÎÀÊ¿ÔÚÏßÉý¼¶ÄÇÑù¡£µ«ÊÇ£¬WindowsÊDz»ÔÊÐíɾ³ýÕý´¦ÓÚÔËÐÐ״̬µÄÓ¦ÓóÌÐòµÄ£¬Ôõô°ì£¿Ò»°ãÀ´Ëµ£¬ÎÒÃÇ¿ÉÒÔʹÓÃÁ½¸ö³ÌÐòÀ´ÊµÏÖ£¬Ò»¸öרߺÔð°æ±¾¼ì²âºÍɾ³ý£¬Ò»¸ö²ÅÊÇÒµÎñÐèÒªµÄÖ÷Ó¦ÓóÌÐò¡£Äܲ»Äܽ«¶þÕߺ϶þΪһÄØ£¿´ ......