delphi

How Can I Add An Item To Folders Menu Of Right Click?

I need to add an item to folders right click menu when clicked send folder address to my app. how can i do it? it'll be a great help if you describe how to make popup menu for that item and how can i use images for items? something like WinRAR.... and what about file types? same ways? thank you. ...

How to find hard erroneous interface casts in Delphi (Win32)

I am trying to find some mysterious bugs in an application, and believe the cause may be some hard casts on interfaces. Such casts are unsafe in Delphi, for example ISomeInterface(CurrentObj) which should be CurrentObj as ISomeInterface In light of the lack of compiler warnings which in my opinion should be emitted for hard cast...

How do I declare this dll method in Delphi?

I have a function in a DLL (the c header is): int my_c_function( const int cnames[10], const char *delim, size_t delim_size, char *buffer, size_t *buffersize); I've tried function my_c_function(cnames: Array of integer; const delim : PAnsiChar; delim_size : integer; ...

How do I know if the shift is pressed using RawInput?

I'm using RawInput to deal with keystrokes. I'm finding it hard to determine if the shift is pressed together with a key. From the RawInputStructure -> RawKeyboard, I can retrieve the key being pressed but I'm not sure how to go about things if the keys were pressed at the same time. RI.Data.keyboard.VKey (gets the keycode) I'm trying...

display the date 6 month before the date choose from combobox

hi.. i have a combobox that show the month from jan till dec where the user can choose which month they want to view the data..this is for the 1st data.. for i := iYear - 2 to iYear + 1 do begin for j := 1 to 12 do begin dTem := EncodeDate(i, j, 1); sTem := FormatDateTime('mmm yyyy', dTem); cboMonth.Items.Add(sTem); en...

How can I use custom icons in a "Browse for folder" dialog?

There is a nice feature in the "Open Project..." dialog (see image below) in the NetBeans IDE which uses a custom icon for the folder symbols depending on the project type in that folder. For example, if a folder contains a pom.xml file, the Maven project symbol appears. Maybe there also an extension point in the Windows standard dial...

User defined component - how to set tooltip on Component Palette?

So, I created a new component, derived from an existing TControl type. When I installed it, it appeared on the Component Palette (is that what it's called) at the top of Delphi at design time, to allow me to add it to a form. How do I change its tooltip text -the one that shows if I hover over the Component Palette at deign time? ...

Delphi - JPEG error #53

Hello , this is my code : TImage.Picture.LoadFromFile('File.jpg'); but i got JPEG error #53 ! what is the reason for this error? ...

Can I have an dynamic array of IDirect3DVertexBuffer9?

Hello, I am working with Delphi and DirectX. I want an dynamic array of IDirect3DVertexBuffer9. Is it possible? If yes then how? I have written a code for it. But, it seems to be problematic. My code is shown below - totalBuffer := 4; SetLength(g_pVB,totalBuffer); for cnt := 0 to totalBuffer - 1 do begin if FAILED(g_pd3dDevice.C...

OCX keeping parent process open after terminating

I have an ocx written in Delphi 2006 that runs inside IE. Been working fine for years. I recently noticed that the last few releases have resulted in Iexplore process staing in memory even after the web page has been closed. Its been driving me mad tring to figure out how to resolve this one. Something I just noticed now, when I ro a re...

Delphi: StringGrid, position and Context Menu

I'm having a problem with using a TStringGrid and Popup menu I want to know the Row / Column of the cell that was last active when select an item from my Popup menu. However when I click on the popup menu, the StringGrid.Row is returned as -1. I've tried using MouseToCell as part of OnClick, but even after setting SG.Row it still retu...

My code can not find the field (Delphi - Webbrowser)

Hi , i'm using this code to fill out fields of some WebPages , using WebBrowser control : procedure TFrmMain.SetValue(const document: IHTMLDocument2; const formNumber: Integer; const fieldName, newValue: string); var form: IHTMLFormElement; field: IHTMLElement; begin form := WebFormGet(formNumber, document); field := form....

How to use minWidth, minHeight of a DevExpress LayoutControl ?

I have started to use DevExpress LayoutControl a bit. It feels powerful but I don't get it as I want. I want to set a minwidth and minheight of components as you can't have a dialog real small and it still look good. At the same time I want to let the user have arbitrary big size and let the components have equal share of the width and h...

How to set value for checkbox via EmbeddedWB.FillForm ? (Delphi)

Hi , how can i set value for a checkbox via FillForm method ? I tried these but doesn't work : W.FillForm('Chkname', 'True'); W.FillForm('Chkname', '1'); W.FillForm('Chkname', '', 1); ...

How can I stop my TDrawGrid fixed rows from disappearing when I have no non fixed rows?

Hi I have this problem with TDrawGrid with fixed rows (although same applies to fixed cols). If you have .FixedRows = 1, and decrement the value of .RowCount, when it gets to 1, the .FixedRows automatically gets set to 0, and your fixed rows turn white instead of the usual grey - except in column zero. Can I stop this from happening? ...

Use of Try/finally/except

Hi. I have seen this code posted here on StackOverflow: with TDownloadURL.Create(nil) do try URL := 'myurltodownload.com'; filename := 'locationtosaveto'; try ExecuteTarget(nil); except result := false; end; if not FileExists(filename) then result := false; finally free; end; Can't i...

How to read from an external console application?

I have a console application that I didn't write. Is there some easy way to read from it? I need to have the input still on the console window, but read what's being displayed. I care not whether the output displays to the console or not, so long as the input still works. ...

starting and stopping the screensaver

Should have been simple I would have thought. I want to force the PC to go into screen saver mode, and exit it when conditions I am checking in by D2006) app come true. It doesn't seem to work: if ScreenSaverExitRequested then begin SystemParametersInfoResult := SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, @S...

How Do I Properly Call GetLongPathName Using Delphi 2009 and Unicode Strings?

I need to change the old Win98 short path names to long path names. I had a routine that worked fine with Delphi 4, but when I upgraded to Delphi 2009 and Unicode, it didn't work with Unicode strings. I looked around and couldn't find a Unicode-compatible version of it. It appears that the correct routine to use is GetLongPathName from...

copy records in a master/detail clientdataset delphi dbexpress

Hello everyone How can I copy the information of a record from a master/detail clientdataset to a new record or to an existing one. For example I want to copy te data of invoice No. 100 to Invoice No. 150 or the information of invoice No. 100 to a new Invoice With IBX I did that with storedprocedures but I am running into trouble with ...