UWSCサンプルコード 少し修正
Windowsのフォント何がインストールされているのか一覧取得します。
DIM Shell = CREATEOLEOBJ("Shell.Application")
CONST ssfFONTS = 20 //windows特殊フォルダ定数
DIM Folder = Shell.NameSpace(ssfFonts)
DIM FolderItems = Folder.Items
dim sList = ""
FOR n = 0 TO FolderItems.Count - 1
sList = sList + n + "<#TAB>" + FolderItems.Item(n).Name + "<#CR>"
NEXT
SENDSTR(0,sList)
せっかく取得したデータすぐに消えてしまうので、クリップボードにセットしどこかテキストに貼り付けられるようにしました。
| UWSC | Autoit |
| 変数すべての頭に | $ |
| CREATEOLEOBJ() |
ObjCreate()
|
| 文字列結合 + | & |
| “<#TAB>” | @TAB |
| “<#CR>” | @CRLF |
| クリップボードに送る SENDSTR(0,sList) | ClipPut($sList) |
Local $Shell = ObjCreate("Shell.Application")
CONST $ssfFONTS = 20 ;//windows特殊フォルダ定数
Local $Folder = $Shell.NameSpace($ssfFonts)
Local $FolderItems = $Folder.Items
Local $sList = ""
FOR $n = 0 TO $FolderItems.Count - 1
$sList = $sList & $n & @TAB & $FolderItems.Item($n).Name & @CRLF
NEXT
ClipPut($sList)
windowsの特殊ホルダの名前一覧:
一部抜粋:
| ssfDESKTOP | 0x00 (0). Windows desktop—the virtual folder that is the root of the namespace. |
| ssfDRIVES | 0x11 (17). My Computer—the virtual folder that contains everything on the local computer: storage devices, printers, and Control Panel. This folder can also contain mapped network drives. |
| ssfNETWORK | 0x12 (18). Network Neighborhood—the virtual folder that represents the root of the network namespace hierarchy. |
| ssfNETHOOD | 0x13 (19). A file system folder that contains any link objects in the My Network Places virtual folder. It is not the same as ssfNETWORK, which represents the network namespace root. A typical path is C:\Users<i>username\AppData\Roaming\Microsoft\Windows\Network Shortcuts. |
| ssfFONTS | 0x14 (20). C:\Windows\Fonts. 数値またはフォルダ名で良いみたい。 |
| ssfTEMPLATES | 0x15 (21). File system directory that serves as a common repository for document templates. |
| ssfCOMMONSTARTMENU | 0x16 (22). File system directory that contains the programs and folders that appear on the Start menu for all users. A typical path is C:\Documents and Settings\All Users\Start Menu. Valid only for Windows NT systems. |

コメント