Delphi

Get notified if cmd.exe fails to successfully move a file?

梦想的初衷 提交于 2020-01-07 08:27:45
问题 I run cmd.exe to move a file with Administrator rights: ThisParams := '/C move ' + '"' + ThisSourceFile + '"' + ' ' + '"' + ATargetFile + '"'; Winapi.ShellAPI.ShellExecute(0, 'runas', 'cmd.exe', PChar(ThisParams), '', Winapi.Windows.SW_HIDE); Unfortunately, ShellExecute always gives back success, regardless of whether the move action was successful or not (the move action would fail for example if the target file exists and it is read-only or if the target disk is write-protected). So how can

Delphi XE - All blue dots are shifted with one line up

坚强是说给别人听的谎言 提交于 2020-01-07 07:49:13
问题 Since yesterday, all blue dots (compiled lines) in my source code are shifted with one line up. So, the first dot starts at 'var' instead of 'begin' and the last dot is one line before the last 'end' of a function. I deleted all files (starting with DCUs) except DPR, PAS, DFM and DPRJ and recompiled. But the dots are still shifted. How can I fix this? It makes the step=by-step debugging almost impossible. 回答1: It could be that the file is corrupted so that you don't have proper line end

How to filter FireDAC dataset by a DATE value constant?

ε祈祈猫儿з 提交于 2020-01-07 06:24:14
问题 procedure TForm2.Button1Click(Sender: TObject); begin with qryWithFilter do begin Filtered := False; OnFilterRecord := nil; // date separator may be used any from [' ', '-', '\', '.', '/'] // Filter := 'DATA_NAS < (''DatetoStr(date3)'')'; // Filter := 'DATA_NAS < ''28/06/1939'''; // Filter := 'DATA_NAS < (FormatDateTime(''dd/mm/yyyy'', ''28/06/1968''))'; // Filter := 'DATA_NAS < TO_DATE(''1996-07-29'',''yyyy-mm-dd'')'; Filter := 'DATA_NAS < (TO_DATE(''1996-07-29'',''yyyy-mm-dd''))'; Filtered

Load Frames from packages

不羁的心 提交于 2020-01-07 06:24:12
问题 I have three frames inside separate three bpls, in my main application i have created three buttons and , i want to call the frames dynamically(one at a time )when the respective button is clicked (the frame can be shown in any control eg : TPanal) i have already done such a thing using Dlls but some in the Stack overflow community recommended me to use bpl (they said it is easy ), my previous post 回答1: Here there's an article about loading a form from a package (bpl file): http://edn

Delphi XE7 TBannerAd not showing ad on Android

断了今生、忘了曾经 提交于 2020-01-07 06:24:06
问题 I'm trying to test run some admob ads via the TBannerAd component in Delphi xe7, to see if it will work on ios and android. Upon testing the ad seems to load on IOS but on Android nothing happens. I've checked the manifest file and made sure it had the activity and meta data. I'm not sure what the issue is. Could someone shed some light? 回答1: Just checking the obvious - have you enabled the AdMob Service option on the entitlements page in the project options? The entitlements page is new in

how can i make my search box jump from one keyword to another without it check every row of the database? [closed]

旧时模样 提交于 2020-01-07 05:29:05
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I got this code working for my app's search box, unfortunately when it search or filters, it checks every row on the database and then when the searched

Delphi: Convert from windows-1251 to Shift-JIS

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-07 04:59:06
问题 I have a string 'MIROKU' . I want to convert this string to '%82l%82h%82q%82n%82j%82t' . Below is my current function which I have used for converting: function MyEncode(const S: string; const CodePage: Integer): string; var Encoding: TEncoding; Bytes: TBytes; b: Byte; sb: TStringBuilder; begin Encoding := TEncoding.GetEncoding(CodePage); try Bytes := Encoding.GetBytes(S); finally Encoding.Free; end; sb := TStringBuilder.Create; try for b in Bytes do begin sb.Append('%'); sb.Append(IntToHex(b

How to Get Control Panel Categories (Groups) on Windows Vista and Windows 7

六月ゝ 毕业季﹏ 提交于 2020-01-07 04:52:27
问题 Is there a way to get a listing of control panel categories on Windows Vista and Windows 7 using the shell? Is there a way to determine which category an applet is assigned to using conical Names using the shell? such as Microsoft.Mouse is in which category? I have some code that works nicely to display control panel applet names obtained from the shell in a TListView in a Vista Classic ungrouped list. I'd like to try to group the applet names in the TListView similar to Control Panel Classic

detecting windows shell changes

爱⌒轻易说出口 提交于 2020-01-07 04:27:08
问题 I have very limited knowledge of using C Builder, could you give me an example or point me to tutorial showing how to use FindNextChangeNotification in Delphi or ,if it is possible, how to use the C component in delphi? 回答1: One option is use the TJvChangeNotify component, The JVCL support Delphi and C++ Builder. Another option is use the SHChangeNotifyRegister function. see this link Monitoring System Shell Changes using Delphi Bye. 回答2: The ReadDirectoryChanges seems to be the function that

Combobox OnChange event not working

不想你离开。 提交于 2020-01-07 04:21:28
问题 I had an issue with Combobox onchange event: Basically if i select manually an item from combobox1 it load/write/save back the file as planned, but if i want to do the same with a loop when i hit the UpdateBtn , it partially work. (loop is work, and stop on last element, but not create the desired file.) I want to do if i hit the UpdateBtn then the Timer2 kick in , fire (or simulate the manual selection) the onChange event of the Combobox, and create the file as manually works. May i missed