Delphi

Error on LoadURL with TChromium

限于喜欢 提交于 2020-01-09 10:51:31
问题 I found the brilliant Delphi Chromium project for embedding Chrome in a Delphi form. It works well in Delphi7 after a bit of hacking and I can get the demo app running. However when I do my own app with the component, I can't load my own url. I get a access violation. Chromium2.Browser.MainFrame.LoadUrl('http://www.example.com'); The TChromium component is working and I have all the DLLs in the right place, since if I set DefaultUrl it works fine. I have Chromium2 in a TPageControl page and

Is There An Efficient Whole Word Search Function in Delphi?

大城市里の小女人 提交于 2020-01-09 10:25:07
问题 In Delphi 2009 or later (Unicode), are there any built-in functions or small routines written somewhere that will do a reasonably efficient whole word search where you provide the delimiters that define the word, e.g.: function ContainsWord(Word, Str: string): boolean; const { Delim holds the delimiters that are on either side of the word } Delim = ' .;,:(){}"/\<>!?[]'#$91#$92#$93#$94'-+*='#$A0#$84; where: Word: string; { is the Unicode string to search for } Str: string; { is the Unicode

Menu Accelerator Keys Not Showing Up (Delphi 2009)

浪尽此生 提交于 2020-01-09 10:09:19
问题 I've tried my best and cannot figure out what happened here. It worked fine in Delphi 4. After upgrading to Delphi 2009, I don't know if this is the way it is supposed to work, or if it's a problem: This is what my program's menu looks like in Design Mode under Delphi 2009: Notice that every word in the Main Menu and the File submenu have one letter underlined. It is supposed to be like this. This underlined letter is called the Accelerator Key and is standard in Windows applications so that

Menu Accelerator Keys Not Showing Up (Delphi 2009)

拈花ヽ惹草 提交于 2020-01-09 10:09:15
问题 I've tried my best and cannot figure out what happened here. It worked fine in Delphi 4. After upgrading to Delphi 2009, I don't know if this is the way it is supposed to work, or if it's a problem: This is what my program's menu looks like in Design Mode under Delphi 2009: Notice that every word in the Main Menu and the File submenu have one letter underlined. It is supposed to be like this. This underlined letter is called the Accelerator Key and is standard in Windows applications so that

Resource not found error when using TForm as base for a component

六月ゝ 毕业季﹏ 提交于 2020-01-09 08:11:50
问题 I am writing a component and want to change the base type to a TForm however at run time I get the error "Resource TMyComp not found". I guess that this is because there is no dfm but I am not sure what to do about it. Thanks unit Unit65; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TMyComp = class(TForm); TForm65 = class(TForm) Button1: TButton; procedure Button1Click

Can you make a Borderless Application Main Window in Windows, without WS_POPUP style?

守給你的承諾、 提交于 2020-01-09 07:05:57
问题 I want to create a window that will be the main window and that Windows itself recognizes as a main application window. However, when I make my window borderless, and without any non-client area at all, Windows no longer recognizes that this window is an application main window. This has several side effects: WindowsKey+M minimizes all windows except my application's main window. Clicking once on the taskbar (in win7) and then again, should toggle the application main window's state

Can you make a Borderless Application Main Window in Windows, without WS_POPUP style?

风格不统一 提交于 2020-01-09 07:05:31
问题 I want to create a window that will be the main window and that Windows itself recognizes as a main application window. However, when I make my window borderless, and without any non-client area at all, Windows no longer recognizes that this window is an application main window. This has several side effects: WindowsKey+M minimizes all windows except my application's main window. Clicking once on the taskbar (in win7) and then again, should toggle the application main window's state

Delphi 数据类型列表

那年仲夏 提交于 2020-01-08 19:53:48
Delphi 数据类型列表 分类 范围 字节 备注 简单类型 序数 整数 Integer -2147483648 .. 2147483647 4 有符号32位 Cardinal 0 .. 4294967295 4 无符号32位 Shortint -128 .. 127 1 有符号8位 Smallint -32768 .. 32767 2 有符号16位 Longint -2147483648 .. 2147483647 4 有符号32位 Int64 -2 63 .. 2 63 8 有符号64位 Byte 0 .. 255 1 无符号8位 Word 0 .. 65535 2 无符号16位 Longword 0 .. 4294967295 4 无符号32位 字符 AnsiChar(Char) ANSI字符集 8位 WideChar Unicode字符集 16位 布尔 Boolean False < True Ord(False) = 0 Ord(True) = 1 Succ(False) = True Pred(True) = False 1 ByteBool False <> True Ord(False) = 0 Ord(True) <> 0 Succ(False) = True Pred(False) = True 1 WordBool 2 LongBool 4 枚举 子界 实数

delphi 时间差

二次信任 提交于 2020-01-08 19:41:03
unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, System.DateUtils, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls; type TForm1 = class(TForm) Edit1: TEdit; Edit2: TEdit; Button1: TButton; DateTimePicker1: TDateTimePicker; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function GetSubDateTime(S1, S2:string): string; var T1, T2: TDateTime; D, H, M, S: Integer; Value: Int64; begin T1 :=

Delphi 通过脚本 在 设计期 改 控件name 属性

孤街浪徒 提交于 2020-01-07 16:06:35
program ScriptRenameZL; uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, TypInfo, ToolsAPI,CnCommon, CnWizUtils,CnWizIdeUtils,IdeInstComp; //IdeInstComp CnWizIdeUtils CnWizUtils { Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, TypInfo, ToolsAPI,CnCommon, CnWizUtils,CnWizIdeUtils;} var //DesignContainer, Comp: TComponent; DesignContainer:TCustomForm; comp:TWinControl; I,CompCount: Integer; begin //for I := 0 to Screen.FormCount - 1 do { var Menu: TMenuItem; MainForm: TCustomForm; Component: TComponent; begin MainForm := GetIdeMainForm; if