Page 21 of 96

Posted: Tue Feb 07, 2012 6:20 pm
by KDJ
SendData.js
Fixed minor bugs.

Posted: Sat Feb 11, 2012 7:44 pm
by KDJ
File&Stream_functions.js
Rename script:
FileStreams_functions.js -> File&Stream_functions.js

Add: NTFS streams for directories

Rename functions:
IsSupportFileStreams() -> IsSupportStreams()
IsFileStreamExists() -> IsStreamExists()
CreateFileStream() -> CreateFile()
DeleteFileStream() -> DeleteFile()
WriteFileStream() -> WriteStream()
EnumFileStreams() -> EnumStreams()

Add functions:
GetFileAttr()
IsDriveExists()
IsDirExists()
IsFileExists()
CopyFile()
RenameFile()

Posted: Sat Feb 11, 2012 8:05 pm
by FeyFre
KDJ
FileStreams_functions.js -> File&Stream_functions.js
This is really bad idea. In most case shell(as much as user) threat & as special symbol(yes, in most cases they handle it as part of filename correctly too), but there can be unpredicted consequences in some software.

Posted: Sat Feb 11, 2012 8:23 pm
by KDJ
FeyFre
What would be the negative consequences of using an ampersand in the filename?

Posted: Sat Feb 11, 2012 9:07 pm
by KDJ
OK
I renamed again:
File&Stream_functions.js -> FileAndStream_functions.js

Posted: Sat Feb 11, 2012 9:22 pm
by KDJ

Posted: Sun Feb 12, 2012 3:16 pm
by Infocatcher

Posted: Wed Feb 15, 2012 8:24 pm
by KDJ
FileAndStream.js
Added:
Shift+F5 - copy in one panel,
Left - go to parent dir,
Right - go to sub dir,
Ctrl+\ - go to main dir,
buttons: "\", "..", "<-", "->",
change drive after pressing char key on drives list.

Posted: Thu Feb 16, 2012 12:53 am
by Instructor
KDJ
RE: FileAndStream.js

Speed optimizations:
1.

Code: Select all

AkelPad.WindowSubClass(aWnd[i][HWND], ListCallback);
->

Code: Select all

AkelPad.WindowSubClass(aWnd[i][HWND], ListCallback, 0x87 /*WM_GETDLGCODE*/, 257 /*WM_KEYUP*/);
2. Use SetWndFontAndText with filled second parameter only in WM_CREATE.

Code: Select all

function SetWndFontAndText(hWnd, hFont, sText)
{
  AkelPad.SendMessage(hWnd, 48 /*WM_SETFONT*/, hFont, true);
  oSys.Call("user32::SetWindowText" + _TCHAR, hWnd, sText);
}
->

Code: Select all

function SetWndFontAndText(hWnd, hFont, sText)
{
  if (hFont) AkelPad.SendMessage(hWnd, 48 /*WM_SETFONT*/, hFont, 1);
  oSys.Call("user32::SetWindowText" + _TCHAR, hWnd, sText);
}
Call SetWndFontAndText outside of WM_CREATE with zero in second parameter or simply use

Code: Select all

oSys.Call("user32::SetWindowText" + _TCHAR, hWnd, sText);
After this - "File and Stream" dialog almost not flickers when became to foreground on my system.

Posted: Thu Feb 16, 2012 1:32 pm
by VladSh
Изменены:
TranslateWithGoogleAPI.js - если перевод не выполнен (слово было неверно написано, поэтому возвращается тот же текст), то выдаётся сообщение, что перевод отсутствует.

CommonFunctions.js - добавлена функция получения расширения по применённой к файлу теме (по коду Instructor'а), это нужно было для усовершенстования нижеперечисленных скриптов.
OpenCoderParamsFile.js;
SaveAs.js.


Добавлено:
1. Ещё раз изменён CommonFunctions.js, - пофиксена ситуация, когда расширение определено, но отсутствует в списке-файле FileDialogExtentions.param, - выдаём его в имени файла, чтобы и в таком случае можно было сохранить его с правильным расширением.

2. Откорректирован FileDialogExtentions.param, - из HTML-файлов вынесены расширения для php-файлов в отдельную строку, т.к. они сохранялись как html.

Posted: Thu Feb 16, 2012 9:08 pm
by KDJ
FileAndStream.js
Corrected according to the recommendations of Instructor.

Added:
Ctrl+Enter - run AkelPad script,
Shift+Enter - run AkelPad script with arguments.

Posted: Fri Feb 17, 2012 9:18 am
by VladSh
Изменён CommentsExt.js, - добавлена установка комментариев для coder- и spck-файлов.


Добавлено:
Instructor
Вы можете "разбить" функционал ChmKeyword.js на 2 части: "определение, есть ли в chm'нике вхождение" и "открытие вхождения"? Просто в этом же скрипте выделить в 2 функции?
Я хотел в своём скрипте сначала узнать, есть ли вхождение в chm, тогда открывать Вашим скриптом, а если нет, то открывать в документации по скрипту с помощью OpenScriptsHelp.js. И посадить на Ctrl+F1, как в IDE'хах.


Добавлено-2:
Откорректирован CodeFoldSwitcher.js, - исправлен баг "мигания" окошка фолдинга при запуске "Область навигации с окном" (оно скрывалось) после выгрузки проги с открытым окошком фолдинга, загрузке снова и выполнении вышеуказанного варианта запуска скрипта.

Posted: Sat Feb 18, 2012 5:54 pm
by KDJ
I need to display file or directory properties dialog box.
I tried to do this by using ShellExecuteEx function.
But this function generates error ERROR_ACCESS_DENIED.
Can anyone help me solve the problem?

Code: Select all

FileProperties("C:\\WINDOWS", AkelPad.GetMainWnd());

function FileProperties(sFile, hWnd)
{
  var oSys      = AkelPad.SystemFunction();
  var sVerb     = "properties";
  var nInfoSize = 16 * 4;
  var lpInfo    = AkelPad.MemAlloc(nInfoSize); //SHELLEXECUTEINFO
  var lpVerb    = AkelPad.MemAlloc((sVerb.length + 1) * _TSIZE);
  var lpFile    = AkelPad.MemAlloc((sFile.length + 1) * _TSIZE);

  AkelPad.MemCopy(lpVerb, sVerb, _TSTR);
  AkelPad.MemCopy(lpFile, sFile, _TSTR);

  AkelPad.MemCopy(lpInfo, nInfoSize, 3 /*DT_DWORD*/); //cbSize
  AkelPad.MemCopy(lpInfo + 4, 0x0000000C /*SEE_MASK_INVOKEIDLIST*/, 3 /*DT_DWORD*/); //fMask
  if (hWnd)
    AkelPad.MemCopy(lpInfo + 8, hWnd, 3 /*DT_DWORD*/); //hwnd
  AkelPad.MemCopy(lpInfo + 12, lpVerb, 3 /*DT_DWORD*/); //lpVerb
  AkelPad.MemCopy(lpInfo + 16, lpFile, 3 /*DT_DWORD*/); //lpFile
  AkelPad.MemCopy(lpInfo + 28, 5 /*SW_SHOW*/, 3 /*DT_DWORD*/); //nShow

  if (! oSys.Call("Shell32::ShellExecuteEx" + _TCHAR, lpInfo))
    AkelPad.MessageBox(hWnd, "hInstApp: " + AkelPad.MemRead(lpInfo + 32, 3 /*DT_DWORD*/) + "\nLastError: " + oSys.GetLastError(), "Error", 0x00000030 /*MB_ICONWARNING*/);

  AkelPad.MemFree(lpInfo);
  AkelPad.MemFree(lpVerb);
  AkelPad.MemFree(lpFile);
}

//typedef struct _SHELLEXECUTEINFO {
//  DWORD     cbSize;
//  ULONG     fMask;
//  HWND      hwnd;
//  LPCTSTR   lpVerb;
//  LPCTSTR   lpFile;
//  LPCTSTR   lpParameters;
//  LPCTSTR   lpDirectory;
//  int       nShow;
//  HINSTANCE hInstApp;
//  LPVOID    lpIDList;
//  LPCTSTR   lpClass;
//  HKEY      hkeyClass;
//  DWORD     dwHotKey;
//  union {
//    HANDLE hIcon;
//    HANDLE hMonitor;
//  } DUMMYUNIONNAME;
//  HANDLE    hProcess;
//} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;

Posted: Sat Feb 18, 2012 7:25 pm
by FeyFre
KDJ, your mistake is

Code: Select all

var nInfoSize = 16 * 4;
it should be

Code: Select all

var nInfoSize = 15 * 4;
Change it and it will work.
union keyword means enclosed into {} declarations will be located in the same memory location, and total size of whole union will be equal size of largest declaration(not sum).

Posted: Sat Feb 18, 2012 8:30 pm
by KDJ
FeyFre
Thank you very much. As always, you are reliable.