立ち上がりが遅い2007年02月06日 10時07分33秒

長い間使っていると

1.ドライブに空が少なくなる

2.初期起動のプログラムが増えてメモリーが足らない

  ・プログラムの切り替えが遅いときにディスクにアクセスしているときはメモリかも

3.デフラグでディスクの整理

リモートPCの時間を取る2007年02月06日 10時16分54秒

Option Compare Database Option Explicit

Private Declare Function NetApiBufferFree Lib "netapi32.dll"

   (ByVal Buffer As Long) As Long

'Private Declare Function RtlMoveMemory Lib "kernel32"

   (Destination As Any, Source As Any, ByVal 

Length As Long)

Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory"

   (Destination As Any, Source As Any, ByVal Length As 

Long)

Private Declare Function NetRemoteTOD Lib "netapi32.dll"

   (ByVal servername As String, BufferPtr As Any) 

As Long

                         

Private Type TIME_OF_DAY_INFO

   tod_1 As Long
   tod_2 As Long
   tod_3 As Long
   tod_4 As Long
   tod_5 As Long
   tod_6 As Long
   tod_7 As Long
   tod_8 As Long
   tod_9 As Long
   tod_10 As Long
   tod_11 As Long
   tod_12 As Long

End Type

Private Sub リモートPCシステム時間_Click()

   Dim udtTODInfo As TIME_OF_DAY_INFO
   Dim strServerName As String
   Dim lngBufPtr As Long
   Dim lngReturn As Long
   
   strServerName = StrConv&("\\SERVER", vbUnicode)

' strServerName = StrConv&("", vbUnicode)'自PCの時間

   
   lngReturn = NetRemoteTOD(strServerName, lngBufPtr)
   
   MoveMemory udtTODInfo, ByVal lngBufPtr, Len(udtTODInfo)
   
   If lngBufPtr <> 0 Then
       lngReturn = NetApiBufferFree&(lngBufPtr)
   End If
   
   With udtTODInfo
       Debug.Print .tod_1; "秒(from 1970/1/1 GNT)"
       Debug.Print .tod_2; "ミリ秒"
       Debug.Print .tod_3; "時"
       Debug.Print .tod_4; "分"
       Debug.Print .tod_5; "秒"
       Debug.Print .tod_6; "1/100秒"
       Debug.Print .tod_7; "分(タイムゾーン)"
       Debug.Print .tod_8; "1/10000秒(インターバル)"
       Debug.Print .tod_9; "日"
       Debug.Print .tod_10; "月"
       Debug.Print .tod_11; "年"
       Debug.Print .tod_12; "番目の曜日"
   End With
    

「VB6.0 300の技」参考

 

End Sub

Outlookで開けれない添付ファイル2007年02月13日 11時00分00秒

レジストリの編集で可能

PC識別情報の取得2007年02月16日 18時39分13秒

プロダクトID(ProductId) HKEY_LOCAL_MACHINE|Software\Microsoft\Windows\CurrentVersion

にある。XP、2000でも同じだった。

WMIを使用するとVBAで簡単に取得できた。 Dim Reg As SWbemObject Dim Locator As SWbemLocator Dim Service As SWbemServices Dim sRet As String Dim TmpbRet As String Dim I As Long

Set Locator = New WbemScripting.SWbemLocator Set Service = Locator.ConnectServer(vbNullString, "root\default") Set Reg = Service.Get("StdRegProv")

Const HKEY_LOCAL_MACHINE = &H80000002

'文字列値 Reg.GetStringValue HKEY_LOCAL_MACHINE,   "Software\Microsoft\Windows\CurrentVersion", "ProductId", sRet

MsgBox sRet

Set Reg = Nothing Set Service = Nothing Set Locator = Nothing

フォームのコンボボックスを最新情報に変更する2007年02月21日 10時24分09秒

コンボボックスの元データを変更した場合にそれを反映させるとき

Forms![フォーム名].controls("コンボボックス").Requery