Jump to content

Ian Branch

Members
  • Content Count

    1431
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Ian Branch

  1. Ian Branch

    Screen Capture a Form??

    Yes, I am playing with it att with mixed results.
  2. Ian Branch

    Screen Capture a Form??

    Hi Team, I'm not having much luck here. I now have this code: procedure TMainForm.CaptureDialog(WindowHandle: HWND; SaveToClipboard: Boolean; FileName: string = ''); var dcWindow: HDC; dcMem: HDC; bmp: TBitmap; begin dcWindow := GetDC(WindowHandle); try dcMem := CreateCompatibleDC(dcWindow); try bmp := TBitmap.Create; try bmp.Width := GetSystemMetrics(SM_CXSCREEN); bmp.Height := GetSystemMetrics(SM_CYSCREEN); SelectObject(dcMem, bmp.Canvas.Handle); // Adjust PrintWindow options as needed PrintWindow(WindowHandle, dcMem, $1); if SaveToClipboard then begin Clipboard.SetAsHandle(CF_BITMAP, bmp.Handle); end; if FileName <> '' then begin bmp.SaveToFile(FileName); end; finally bmp.Free; end; finally DeleteDC(dcMem); end; finally ReleaseDC(WindowHandle, dcWindow); end; end; procedure TMainForm.Button1Click(Sender: TObject); begin CaptureDialog(Application.ActiveFormHandle, False, GetDesktopPath+'ScreenCapture2015.bmp'); end; When I click the button on the form I get an 'image' saved OK but it is all white and looks suspiciously like an all white screen. 😞 Thoughts/suggestions appreciated. Regards & TIA, Ian
  3. Ian Branch

    Help with 'Continue' pls.

    Hi Team, Using D12. It may be my missunderstanding but.. I have the following code: Suppliers.First; // while not Suppliers.eof do begin // sSelected := Suppliers.FieldByName('SupplierCode').AsString; sDescription := Suppliers.FieldByName('SupplName').AsString; // Parts.Close; Parts.SQL.Clear; Parts.SQL.Text := 'Select * from Parts where SupplierCode = ' + quotedStr(sSelected) + ' and BusCode = ' + QuotedStr(sBusCode); Parts.Prepare; Parts.Open; // if Parts.eof then begin // TaskMessageDlg('No parts available!', 'There are no Parts on record for Supplier - ' + sDescription + ' at location ' + sLocation + '.', // mtInformation, [mbOK], 0) Label1.Caption := 'There are no Parts on record for Supplier - ' + sDescription + ' at location ' + sLocation + '.'; // Suppliers.Next; // Continue; // end else begin // Omitting the Suppliers.Next for the moment, I allways thought that a Continue would have automatically caused Suppliers to move to the next record by virtue of the 'while not Suppliers.eof do'. In my case of the code above, it doesn't, I had to insert the Suppliers.Next; line. Was my understand incorrect or is there some other explanation? Regards & TIA, Ian
  4. Ian Branch

    Help with 'Continue' pls.

    Thanks Guys, It's surprising I have operated under this missunderstanding for so long.... 😞 All good now. Again, thank you. Regards, Ian
  5. Ian Branch

    Help with 'Continue' pls.

    Hi Stano, Tks for the reference. OK, so it doesn't cause the step. I need to review a few other pieces of code. 😞 Rightly or wrongly, I have always worked on it stepping.
  6. Ian Branch

    INTAServices.AddMasked seems to be broken in Delphi 12

    Dowloaded and installed the latest rev 4182. After 20 minutes of testing, all good so far.
  7. Ian Branch

    INTAServices.AddMasked seems to be broken in Delphi 12

    Downloaded and installed. What specifically would you like tested?
  8. Ian Branch

    Edits not saved??

    Hi Team, D11.3. This may be a setting I am not aware of and/or have forgotten about, I do not recall experiencing this in D11.2. Occasionally, after I have edit a Unit and saved it, exited, and come back to it later, I find my edits have not taken. It's as if the edits didn't happen. Yes, I am confident I have saved my work. Have I missed some setting?? Anybody else experience this?? Regards & TIA, Ian
  9. Hi Team, I can't find any worked examples of the above. Anybody got any experience? Appreciate any examples. Regards & TIA, Ian
  10. Ian Branch

    How to use the Jedi JVCL TJvLoginDialog component??

    Disregard - All sorted. Happy New Year...
  11. Ian Branch

    Handing over the baton to Thomas and Lars

    Hi Daniel, Thank you for all the work & effort you have put in to this valuable tool. Very much appreciated. Regards, Ian
  12. Ian Branch

    EurekaLog 7.12.0.4 installation

    I have downloaded it OK.
  13. If its an issue for you, I suggest RunTime ToolKit
  14. There isn't one per se. It tells you that it has tried to open a second instance of GExperts.
  15. GExperts works fine in D12...
  16. Hi Team, D12. I have the following function: function GetWeekDates(const GivenDate: TDateTime; const SOWDay: string; out startDate, endDate: TDateTime): Boolean; I want to modify it so that SOWDay has a default value of 'SU' if SOWDay isn't supplied. As SOWDay must be By-Value or a Constant, I can't do this: function GetWeekDates(const GivenDate: TDateTime; var SOWDay: string = 'SU'; out startDate, endDate: TDateTime): Boolean; is what I am after possible? Delete Reference: I did it with an overloaded function. Regards & TIA, Ian
  17. Ian Branch

    Set a default parameter for a function??

    Hi pmvgee, Your assumption was correct. This option has fascinated me a little but I can't help wondering if it is technology for the sake of technology... I can't see 'out' parameters dissappearing in any forseeable future so what advantage do tuples bring to the table/keyboard? As far as I can see, In order to implement them you need another code set to support them. I found 'generics.tuples.pas' from Malcolm Groves, on the face of it, it seems a whole lot of code for little gain. Ian
  18. Ian Branch

    Set a default parameter for a function??

    Hi pmcgee, Interesting, never come across them nor can I say I have seen them. What does FAIL represent? Ian
  19. If they must code like that, :-(, make it one space after the comment.
  20. Hi Team, I had both D11 & D12 installed while I validated all my Apps into D12. No problems there. I had Parnassus Bookmarks installed in both. Today I deinstalled D11 and D12 won't start properly because it can't fine ParnassusCoreEditor.dll. 😞 What do I need to delete and where to get D12 to start fully so I can reinstall Bookmarks?? Regards & TIA, Ian
  21. Ian Branch

    Uninstalled D11, now D12 won't start....

    Resolved. Deleted both Parnassus BookMarks & CoreEditor entries in the registry just to be safe, then used AutoGetit to reinstall it/them. All good now.
  22. Ian Branch

    Uninstalled D11, now D12 won't start....

    None found in the entire registry. 😞
  23. Ian Branch

    Edits not saved??

    I think I eventually discovered the same thing. Too long ago now... 😉
  24. Ian Branch

    Set a default parameter for a function??

    Tks uligerhart. That's what I did initially to get it going. I will adapt to the reordered parameters. Ian
  25. Ian Branch

    Set a default parameter for a function??

    Ahhhhhhh. That was what I was missing. I was not aware of that. Thank you FPiette. I will just have to remember the order of parameters when I call the function. 😉 Regards, Ian
×