|
|
|
Как забраться в папку "C:\Document And Set..\..\Главное меню"?
|
|||
|---|---|---|---|
|
#18+
Пробовал FSO, Shell, Dir - никто туда не хочет лезть! В какую сторону копать? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.06.2006, 14:20 |
|
||
|
Как забраться в папку "C:\Document And Set..\..\Главное меню"?
|
|||
|---|---|---|---|
|
#18+
А что-то типа отсюда почерпнуть?(кусок старого кода по созданию ярлыков в меню Пуск...) procedure TForml.ButtonlClick(Sender: TObject); var WorkTable:String; P:PItemIDList; C:array [0..1000] of char; begin if SHGetSpecialFolderLocation (Handle, CSIDL_PROGRAMS,p)=NOERROR then begin SHGetPathFromlDList(P,C); 330 Глава 7 WorkTable:=StrPas(C)+'\My Group'; end; if not DirectoryExists(WorkTable) then MkDir(WorkTable); if FileExists(WorkTable+'\'+ExtractFileName(Application.ExeName)) then DeleteFile(WorkTable+'\'+ExtractFileName(Application.ExeName)); CreateShotCut(Application.ExeName, WorkTable + '\'+ ExtractFileNarne (Application.ExeName) , ' ') ; end; И, собственно, создание ярлыков(вдруг пригодится): procedure TForml.CreateShotCut(SourceFile, ShortCutName, SourceParams: String); var IUnk: IUnknown; ShellLink: IShellLink; ShellFile: IPersistFile; tmpShortCutName: string; WideStr: WideString; i: Integer; begin IUnk := CreateComObject(CLSID_ShellLink); ShellLink := IUnk as IShellLink; ShellFile := IUnk as IPersistFile; ShellLink.SetPath(PChar(SourceFile)); ShellLink.SetArguments(PChar(SourceParams)); ShellLink.SetWorkingDirectory(PChar{ExtractFilePath(SourceFile))); ShortCutName := ChangeFileExt(ShortCutName,'.Ink"); if fileexists(ShortCutName) then begin ShortCutName := copy(ShortCutName,1,length(ShortCutName)-4); i := 1; repeat tmpShortCutName := ShortCutName +'(' + inttostr(i)+ ').lnk'; inc(i); until not fileexists(tmpShortCutName); WideStr := tmpShortCutName; end else WideStr := ShortCutName; ShellFile.SavetPWChar(WideStr),False); end; ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.06.2006, 14:57 |
|
||
|
Как забраться в папку "C:\Document And Set..\..\Главное меню"?
|
|||
|---|---|---|---|
|
#18+
только не Basic :) Le0n@rd0А что-то типа отсюда почерпнуть?(кусок старого кода по созданию ярлыков в меню Пуск...) procedure TForml.ButtonlClick(Sender: TObject); var WorkTable:String; P:PItemIDList; C:array [0..1000] of char; begin if SHGetSpecialFolderLocation (Handle, CSIDL_PROGRAMS,p)=NOERROR then begin SHGetPathFromlDList(P,C); 330 Глава 7 WorkTable:=StrPas(C)+'\My Group'; end; if not DirectoryExists(WorkTable) then MkDir(WorkTable); if FileExists(WorkTable+'\'+ExtractFileName(Application.ExeName)) then DeleteFile(WorkTable+'\'+ExtractFileName(Application.ExeName)); CreateShotCut(Application.ExeName, WorkTable + '\'+ ExtractFileNarne (Application.ExeName) , ' ') ; end; И, собственно, создание ярлыков(вдруг пригодится): procedure TForml.CreateShotCut(SourceFile, ShortCutName, SourceParams: String); var IUnk: IUnknown; ShellLink: IShellLink; ShellFile: IPersistFile; tmpShortCutName: string; WideStr: WideString; i: Integer; begin IUnk := CreateComObject(CLSID_ShellLink); ShellLink := IUnk as IShellLink; ShellFile := IUnk as IPersistFile; ShellLink.SetPath(PChar(SourceFile)); ShellLink.SetArguments(PChar(SourceParams)); ShellLink.SetWorkingDirectory(PChar{ExtractFilePath(SourceFile))); ShortCutName := ChangeFileExt(ShortCutName,'.Ink"); if fileexists(ShortCutName) then begin ShortCutName := copy(ShortCutName,1,length(ShortCutName)-4); i := 1; repeat tmpShortCutName := ShortCutName +'(' + inttostr(i)+ ').lnk'; inc(i); until not fileexists(tmpShortCutName); WideStr := tmpShortCutName; end else WideStr := ShortCutName; ShellFile.SavetPWChar(WideStr),False); end; ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.06.2006, 15:05 |
|
||
|
|

start [/forum/topic.php?fid=60&msg=33812913&tid=2165674]: |
0ms |
get settings: |
9ms |
get forum list: |
21ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
177ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
57ms |
get tp. blocked users: |
2ms |
| others: | 209ms |
| total: | 496ms |

| 0 / 0 |
