我正在使用此代码来检测PC上的WindowsVersion.
function GetOS: string;
var
osVerInfo: TOSVersionInfo;
majorVer, minorVer: Integer;
begin
Result := 'Unknown';
osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
if GetVersionEx(osVerInfo) then
begin
majorVer := osVerInfo.dwMajorVersion;
minorVer := osVerInfo.dwMinorVersion;
case osVerInfo.dwPlatformId of
VER_PLATFORM_WIN32_NT: {Mirosoft Windows NT/2000 }
begin
if majorVer <= 4 then
Result := 'Win NT'
else if (majorVer = 5) and (minorVer = 0) then
Result := 'Win 2k'
else if (majorVer = 5) and (minorVer = 1) then
Result := 'Win XP'
else if (majorVer = 6) and (minorVer …
Run Code Online (Sandbox Code Playgroud) 我在Delphi 7中使用SoftGem的VirtualStringTree.
有没有办法启用完整的网格线(就像在TListView中一样)?我只能找到toShowHorzGridLines
,它只显示当前节点的行,而不是下面空白空间中的任何内容,并且toShowVertGridLines
只显示垂直线.
如何在添加项目之前在空白区域中显示它们?
我想用一个字节数组分配空间(动态大小)并得到一个指向"spacearea"的指针,如果我不再需要它,可以在以后释放它.
我了解VirtualAlloc,VirutalAllocEx和LocalAlloc.哪一个是最好的,如何在之后释放内存?
谢谢您的帮助.
我想选择所有根节点或所有子节点(不是VirtualTreeView中的所有节点).
我试图使用此代码来选择所有根节点:
procedure SelectAllRoots;
var
Node: PVirtualNode;
begin
Form1.VirtualStringTree1.BeginUpdate;
Node := Form1.VirtualStringTree1.GetFirst;
while True do
begin
if Node = nil then
Break;
if not (vsSelected in Node.States) then
Node.States := Node.States + [vsSelected];
Node := Form1.VirtualStringTree1.GetNext(Node);
end;
Form1.VirtualStringTree1.EndUpdate;
end;
Run Code Online (Sandbox Code Playgroud)
我可以说有一个小故障.选择不完整或卡住.我究竟做错了什么 ?
编辑:
我使用MultiSelection.
我最近将我的Delphi 7升级到了Delphi XE2,我对它有点新意.我使用Indy 10和OpenSSL来接收HTTP内容.它运作得很好,我想与其他人分享我的程序.我刚刚发现,如果没有OpenSSL库,我的程序将无法在其他PC上运行.我甚至没有得到丢失的DLL文件的异常,错误等.我认为Indy10具有本机SSL支持或者至少在编译后使用资源中的DLL,因此它是可移植的.我有两个问题:
1)我怎样才能让用户知道他/她错过了OpenSSL库?(我的朋友报告没有异常,错误等,没有OpenSSL DLL.)
2)是否可以让Indy10从资源中读取OpenSSL库?
我目前正在研究适用于 Windows 的 VersionInfo Resource(s)。VS_VERSIONINFO/VS_FIXEDFILEINFO
一个VS_VERSION_INFO
资源中可以有多个结构,这有点令人困惑。
据我所知,您可以拥有多个RT_VERSION->VS_VERSION_INFO
具有不同语言 ID 的资源。(就像图中所示)
这 2 个语言 ID ( 0 and 1031
) 实际上VS_VERSIONINFO/VS_FIXEDFILEINFO
每个都有 2 个不同。
0
是一种中性语言,似乎优先于您的实际本地语言 ID(即1031
)。
对我来说,这似乎有点混乱和混乱。VS_VERSIONINFO
一个VS_VERSION_INFO
资源中怎么可能有多个结构,重点是什么?Windows 如何解释多个资源、结构?当你调用时怎么可能只得到一块缓冲区GetFileVersionInfo
?
这一切对我来说毫无意义,我找不到太多关于它的文档。
我想得到一个结构/记录的"位置".
说我有这个记录:
type
MyStruct = record
MyInteger : Integer;
MyInteger2 : Integer;
MyInteger3 : Integer;
MyFunc : function (FirstParam : WideString; SecondParam : String) : Integer;
MyString : String;
MyString2 : WideString;
MyPchar : pchar;
end;
Run Code Online (Sandbox Code Playgroud)
如您所见,此记录的大小为28字节(7个字符x 4个字节).基本上因为所有变量都是4字节变量(如整数)或指针(也是4字节).现在假设我们将这个结构加载到一个内存地址(X = 0)(这也意味着MyInteger的地址为0).MyInteger3的地址(例如)将为8(请注意X = 0!)如何动态获取结构的位置(数字/地址)?
希望你们知道我的意思吗?提前致谢.
BTW:结构中任何Var总是4个字节吗?编辑:如果你修复spcae这是错误的:String[100]
我想知道是否有一种方法来显示TForm而不等待它(有点像TForm.Show).但我想要的是阻止所有其他形式(就像在ShowModal中一样)
例:
我有Form1和Form2.Form1有一个按钮,应打开Form2但Form1被阻止,但单击该按钮仍然继续Form2打开后的代码.
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.ShowModal; // ===> Something like that but the Code should continue, yet Form1 and all other forms are blocked (disabled)
MessageBox (0, 'Code continues', '', 0);
end;
Run Code Online (Sandbox Code Playgroud)
希望你知道我的意思.
我知道你需要synchronize (yourprocedure)
设置例如标签的文字.但是关于:
当我需要使用时,是否有一个简单的规则来了解/记住synchronize
?
PS.:同步类似于PostMessage/SendMessage吗?
我这里有这个代码
program Project1;
{$APPTYPE CONSOLE}
function GetCurrentProcessID : Cardinal; stdcall; external 'kernel32.dll';
begin
writeln (GetCurrentProcessID);
readln;
end.
Run Code Online (Sandbox Code Playgroud)
它告诉我GetCurrentProcessID
无法找到入口点.知道为什么吗?
我甚至试过了
function GetCurrentProcessID : Cardinal; stdcall; external 'kernel32.dll'; name 'GetCurrentProcessID';
Run Code Online (Sandbox Code Playgroud)
没有运气......