Jump to content

alank2

Members
  • Content Count

    115
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by alank2

  1. I've read about a win32 api function called PrintWindow, but often in delphi/cppbuilder there is an easier way. I need to get the graphic bitmap of a different application's window. Any tips or ideas?
  2. I've done enough searching to know that it is based on a bitmap; I even remember drilling down and opening a bitmap that looked like the source of how it figures out how to draw controls. I am creating a number the TSpeedButton's programmatically and I have been using the StyleLookup="buttonstyle" which looks mostly like what I want except it has a grayish background which I need to change to a white background. What is the easiest way to accomplish that?
  3. alank2

    TSpeedButton - how to change the background color

    I right clicked it and created a custom style. Then I found the background and edited NormalLink to change where it was pointed to to pointing to the middle of a white box so it would become white. Are you saying you replaced the background TButtonStyleObject with a TRectangle? Can the bitmap graphics that NormalLink points to be edited? What if I wanted to add something to that bitmap?
  4. alank2

    Is there a way to outline text in a TLabel?

    I'm not in love with it, but I ended up using 5 TLabels - one offset to each corner underneath the real one to give it an outline.
  5. alank2

    Is there a way to outline text in a TLabel?

    Many of those examples are large fonts like a WordArt type of thing. Can this approach work on smaller font sizes like 12pt? Thank you for the help!
  6. alank2

    TSpeedButton IsPressed issue

    I created a TSpeedButton and set the StaysPressed property to true. I then was using IsPressed to see if it is pressed or not in the OnClick event. If I click it slowly it works, but if I click it quickly, the 2nd time the event is fired (and it does fire), the IsPressed property is not changed, but is the previous state. void __fastcall TTest::UpdateSearch() { //debug does it fire when clicked fast static int i1; i1++; Label1->Text=i1; if (Search[0]==0) { if (SBSpecialOnly->IsPressed) LSearch->Text="Type to search special"; else LSearch->Text="Type to search"; LSearch->FontColor=claDarkgray; } else { LSearch->FontColor=claBlack; LSearch->Text=Search; } }
  7. alank2

    TSpeedButton IsPressed issue

    Are there any workarounds on this issue?
  8. alank2

    TSpeedButton IsPressed issue

    It seems to be an immediate type thing. If I have code that looks at IsPressed later on, it seems to be correct, but not always in the OnClick that is changing it.
  9. I am pretty new to FireMonkey. What I need is a grid of X wide Y tall buttons that can be clicked. No scrolling. Each button needs a couple text labels and a graphic. I need to build the grid at design time. I don't mind building the controls dynamically if that is easier. My original plan was to use a TSpeedButton and put TLabels and an TImage on it. If I hover over a TLabel, it activates the button, and clicking activates the buttons onclick event not the label's. TImage does not work the same way however - can it be made to allow hovering to pass through to the button underneath it? Or is there a better way to go about this?
  10. Thanks everyone; HitTest property fixed the issue for me!
  11. Using cppbuilder I can load a PNG file into a TImage, but then I want to merge another PNG file into it using CopyRect. I think there is some issue with it not being a bitmap that causes it to give an error when I try. I've tried some searching about this, but didn't really see anything that helped. Is thee a way to load the PNG, then perform some operation on it that renders it as a bitmap that I can then CopyRect to?
  12. Thank you; will give this a try!
  13. The error was can only modify an image if it contains a bitmap. It works with BMP files, but not PNG files. Is the Draw method above something that will convert it from PNG to BMP? I ended up just using two TImage's, one placed on top of the other, to do what needed to be done, but I would have liked to figure out how to make PNG's work with CoptRect(). Thanks!
  14. Thank you; I will give those a try!
  15. Do you have an example of how to do that? I tried something with Draw earlier unsuccessfully as well.
  16. When I turn off the option "Generate underscores on symbol names" to eliminate them, then I get linker errors for some built in library functions: wcslen/wcscpy/wcscmp/qsort_s Any ideas why? I am running 10.3.3
  17. alank2

    DLL without underscore mangled functions

    Thanks Remy; pulling the __declspec(dllexport) allowed me to just export them in the DEF file. I didn't find a way to use a single project for both win32 and win64 so I put them in different projects with different DEF files and used a projectgroup to contain them both.
  18. alank2

    DLL without underscore mangled functions

    ALSO, is there a way to make a DEF file apply to only the 32-bit target platform in cppbuilder?
  19. alank2

    DLL without underscore mangled functions

    I keep reading this, but I am already have the function wrapped in extern "C" and it still has the underscore. DId some C compilers use an underscore and others not? Trying to make sense of this - do I have these right? Without extern "C", will it be the mangled C++ name with parameter suffix? With extern "C", will it simply be mangled to have a simple underscore before it. With extern "C" _and_ generate underscores option off, then it will drop the underscore, but then be incompatible with standard libraries.
  20. The warning is: [bcc64 Warning] file.cpp(1336): ISO C++11 does not allow conversion from string literal to 'wchar_t *' It is from: wchar_t *ConfigurationResultText[]={ L"No error", L"CFGERROR: Unable to create file", L"CFGERROR: Unable to open file or file is busy", L"CFGERROR: Unable to perform file IO", L"CFGERROR: File is not a CFG file", }; It seems that if I put (whcar_t*) before each string, that it eliminates the warning. My question is why? Doesn't the L"string" already mean it is a wchar_t * ? Or does the clang compiler see it as something different? I usually use the classic compiler, but in x64 that is not an option.
  21. alank2

    DLL without underscore mangled functions

    I made a DEF file and put an EXPORTS section into it and added it to the project. I also added lines for each function like this: function=_function This does produce a DLL, but it has both function names in it now. function and _function. Is there a way to remove _function so that only function is present?
  22. Thank you Remy - that explains it. I appreciate the detailed explanation!
  23. I've been using ICS 8.59 with C++ Builder 10.3.3 and as I recall it took some work to tweak/install it. I'm having two issues. The first is that if I add the TSslHttpCli component to a service, it seems to kill or disable codeguard. The application will not produce a .CGL file any longer and I don't think codeguard is working. The second issue is that when I stop the service, normally it shuts down and closes immediately, but just adding the TSslHttpCli component introduces a 60-90 second delay until it finally shuts down. My first question is - I noticed that 8.66 is available with GetIt if I go into Delphi. Can I uninstall 8.59 and then use GetIt to download 8.66 through Delphi? Will it be available in C++ Builder if I do this?
  24. I only have one application that needs to communicate with a web API. I've been using the ICS TSslHttpCli/TSslContext components to do this, but I wonder if I could have one less library dependency and use the built in TIdHTTP instead. This is essentially my communication where I am sending some JSON and then getting some JSON returned: Could TIdHTTP be up for this same task? //set properties SslHttpCli->Timeout=300; SslHttpCli->SslContext=SslContext; SslContext->SslSessionTimeout=300; SslHttpCli->ContentTypePost=L"application/json"; SslHttpCli->ServerAuth=httpAuthNtlm; SslHttpCli->SendStream=parms->senddata; SslHttpCli->RcvdStream=parms->recvdata; SslHttpCli->URL=parms->URL; SslHttpCli->Username=parms->Username; SslHttpCli->Password=parms->Password; try { SslHttpCli->Post(); } catch (Exception &exception) { ExceptionErrorMessage(&exception, NULL, parms->exmsg, 1024); delete SslHttpCli; goto fail2; }
  25. Thanks Angus; will get it out!
×