标签: delphi-xe7

如何更改存储在.exe文件中的StringTable值

我编写了2个程序,它们都被编译,并且都包含通过.rc文件添加的"STRINGTABLES"资源.

所以,让我们调用App#1"app1.exe"和App#2"app2.exe".

这是我的问题.在app2.exe中,我有一个字符串表,如下所示:

STRINGTABLE
{
1000, "Hello"
1001, "There"
}
Run Code Online (Sandbox Code Playgroud)

当我运行app1.exe时,我试图通过Win32 API UpdateResource()函数更新存储在app2.exe中的资源.

我可以使用Delphi的LoadStr()函数从stringtable加载字符串就好了.

我的问题是我需要了解如何使用UpdateResource()才能更改该字符串中的JUST THE STRINGS.因此,例如,我希望app1.exe将app2.exe的字符串表从您上面看到的更改为:

STRINGTABLE
{
1000, "Thank"
1001, "You!"
}
Run Code Online (Sandbox Code Playgroud)

对不起,我没有任何源代码,但是我从头开始,似乎无法解决这个问题.

我正在使用RAD Studio XE7.

如果你们需要更多的东西继续下去,只要这样说,我会尽可能地更新它,但就像我说我刚刚开始学习TResourceStream和所有这些资源的东西所以我没有太多要展示.我可以告诉你的是,我不是编程新手.我很快就抓住了东西.我已经创建了一个THandleapp1.exe来查看app2.exe的资源.我可以添加东西,但似乎当我尝试String从一个TEditTMemo组件添加数据时,它显示为app2.exe资源中的一些奇怪的奇怪的中文字体.所以我想知道如何格式化这些字符串,以便它们在资源和内容中正确显示.

为了更多地了解这一点,当我运行app1.exe并尝试将字符串"Hello"输入app2.exe的stringtable时,它给了我:

00230BF8  00 00 00 00                                       ••••
Run Code Online (Sandbox Code Playgroud)

任何线索为什么?

我在运行程序后使用名为"Resource Hacker"的应用程序来检查资源.

delphi winapi delphi-xe7

-1
推荐指数
1
解决办法
1160
查看次数

如何在不使用所选项目的情况下获取其子项目等于某个字符串的listview项目的索引?

我目前使用的列表视图我的项目中我想通过寻找其子项字符串来获得一些项目的指标,我有项目和子项目列表视图,item caption := namesubitem := id我想找到这个项目,其中的指数sub item := id,我怎么能做到这一点,我搜索虽然对于某些方程而且还没有.我需要这个的原因是因为subitem id有唯一的id而且这个很安全,而不是按标题使用find item

delphi listview delphi-xe7

-1
推荐指数
1
解决办法
2472
查看次数

我如何安全地使用UPX?

我试图upx使用--lzma压缩方法减少我的应用程序大小.

但是,每当我upx在压缩后使用和扫描我的应用程序时,它都会显示此应用程序有病毒.这是出现的病毒结果

创:Adware.Heur.RmTfWDj6fzli

如果我在使用前扫描应用程序upx,应用程序是完全干净的,没有检测到病毒.

我该如何避免这个问题?

我在这里使用upx 391 http://upx.sourceforge.net/

compression delphi upx delphi-xe7

-1
推荐指数
1
解决办法
638
查看次数

如何生成安装程序应用程序delphi xe7

我刚刚完成了一个小的delphi xe7应用程序,它需要一些dll文件才能工作.我应该如何创建应用程序安装程序.exe以在其他PC中安装此类应用程序?

delphi delphi-xe7

-2
推荐指数
1
解决办法
1977
查看次数

设计日志系统

我有一个需要批量处理文件的程序。而不是在屏幕上的消息框中显示错误(这将暂停程序的执行),我需要在用户可以在程序执行时看到的日志中显示这些错误消息。

所以我不需要这样的程序执行日志哪个日志库更好?

我现在正在使用从 TRichEdit 派生的东西。基本上,一个带有一些额外方法的丰富编辑,如 AddError(s)、AddWarn(s)、AddVerbose(s) 等。

  TRichLog = class(TMyRichEdit)
   private
   protected
     Indent: Integer;   { Indent new added lines x spaces }
   public
     constructor Create(AOwner: TComponent);   override;
     procedure AddBold     (CONST Mesaj: string);
     procedure AddMsg      (CONST Mesaj: string);
     procedure AddMsgLvl   (CONST Mesaj: string; MsgType: Integer);
     procedure AddColorMsg (CONST Mesaj: string; Culoare: TColor);
     procedure AddVerb     (CONST Mesaj: string);
     procedure AddHint     (CONST Mesaj: string);
     procedure AddInfo     (CONST Mesaj: string);
     procedure AddPath     (CONST Mesaj: string);
     procedure AddWarn     (CONST Mesaj: string);
     procedure AddError    (CONST …
Run Code Online (Sandbox Code Playgroud)

delphi logging delphi-xe7

-2
推荐指数
1
解决办法
778
查看次数

使用负IconIndex值创建ShellLink时出错

在Delphi XE7中,我使用此代码创建指向特定文件夹的SHELL LINK.此文件夹显示在Windows资源管理器中,其中包含由此文件夹中的desktop.ini文件定义的自定义文件夹图标.应使用desktop.ini文件中的图标参数创建SHELL LINK,即指向与desktop.ini文件相同的图标资源.所以这是代码:

function GetDesktopIniIconDataFromFolder(const APath: string; var VIconIndex: Integer): string;
var
  DeskTopIniFile: string;
  DesktopIni: System.IniFiles.TIniFile;
  ThisIconFileStr, ThisIconIndexStr: string;
  ThisIconIndexInt: Integer;
begin
  Result := '';
  if DirectoryExists(APath) then
  begin
    DeskTopIniFile := IncludeTrailingPathDelimiter(APath) + 'Desktop.ini';
    if FileExists(DeskTopIniFile) then
    begin
      DesktopIni := System.IniFiles.TIniFile.Create(DeskTopIniFile);
      try
        ThisIconFileStr := DesktopIni.ReadString('.ShellClassInfo', 'IconFile', '');
        if ThisIconFileStr <> '' then
        begin
          ThisIconIndexStr := DesktopIni.ReadString('.ShellClassInfo', 'IconIndex', '');
          if ThisIconIndexStr <> '' then
          begin
            ThisIconIndexInt := System.SysUtils.StrToIntDef(ThisIconIndexStr, MaxInt);
            if ThisIconIndexInt <> MaxInt then
            begin
              Result := ThisIconFileStr;
              VIconIndex := …
Run Code Online (Sandbox Code Playgroud)

delphi windows-shell delphi-xe7

-3
推荐指数
1
解决办法
253
查看次数