-
Content Count
562 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Tommi Prami
-
I would need to get position of MenuItem, of top level TMenuItem, so always visible. I would like to show balloonhint on top of that, to tell user that, you should go in this menu, to process stuff, pretty much now, if suints your timetable 😉 -Tee-
-
How to get position of Top-level TMenuItem of Main menu
Tommi Prami replied to Tommi Prami's topic in Windows API
Could this be messed up with visual form inheritance. It works in clean demo app, basically your code, with those name changes I've made. Have to typecast the constant because otherwise I'll get an Constant violates subrange bounds error, but not even that matter/happen in a clean new App. -Tee- -
How to get position of Top-level TMenuItem of Main menu
Tommi Prami replied to Tommi Prami's topic in Windows API
type {$A8} // default quadword-alignment PSTMenuBarInfo = ^TSTMenuBarInfo; tagSTMENUBARINFO = record cbSize: DWORD; rcBar: TRect; hMenu: HMENU; hwndMenu: HWND; { fBarFocused:1: BOOL;} { bar, popup has the focus } { fFocused:1: BOOL; } { item has the focus } FocusedBits: BYTE; end; TSTMenuBarInfo = tagSTMENUBARINFO; function STGetMenuBarInfo(hend: HWND; idObject, idItem: Longint; var pmbi: TSTMenuBarInfo): BOOL; stdcall; external user32 name 'GetMenuBarInfo'; function GetWindowMenuItemRect(const AHandle: THandle; const AIndex: Integer): TRect; var LMenuBarInfo: TSTMenuBarInfo; begin FillChar(LMenuBarInfo, SizeOf(TSTMenuBarInfo), 0); LMenuBarInfo.cbSize := SizeOf(TSTMenuBarInfo); {$RANGECHECKS OFF} {$OVERFLOWCHECKS OFF} {$WARN SYMBOL_PLATFORM OFF} Win32Check(STGetMenuBarInfo(AHandle, Longint($FFFFFFFD), AIndex, LMenuBarInfo)); {$WARN SYMBOL_PLATFORM ON} {$OVERFLOWCHECKS ON} {$RANGECHECKS ON} Result := LMenuBarInfo.rcBar; end; Changed types and method name to make sure it uses different types, added some far fetched compiler defines. Same code works using rest of your code. But failed on app that woulöd actually need to use it :). Have an idea tough... Gives me System Error. Code: 1400. Invalid window handle LEt me see... btw... Thanks for help! -
How to get position of Top-level TMenuItem of Main menu
Tommi Prami replied to Tommi Prami's topic in Windows API
Thanks, Can't see any difference but if I copy record and external method declarations from github, it compiles. weirdest thing ever 😄 -
How to get position of Top-level TMenuItem of Main menu
Tommi Prami replied to Tommi Prami's topic in Windows API
Thanks, I see nothing wrong in that, but I just can't see why Compiler does not like it. It might be something trivial, but I just can't figure it out. TMenuBarInfo = tagMENUBARINFO; // <- [dcc32 Error] : E2029 '=' expected but identifier 'TMenuBarInfo' found -
How to get position of Top-level TMenuItem of Main menu
Tommi Prami replied to Tommi Prami's topic in Windows API
Tried all combinations of different handles and indexes, I could think of... Damnation. Now have to go tortured by the Dentist, and not event the Delphi-coding one 😞 -
How to get position of Top-level TMenuItem of Main menu
Tommi Prami replied to Tommi Prami's topic in Windows API
Thanks man, I'll check... Gort to make couple of changes to make it compile, weirdly it did not allow me to assign Returned rect to result. Type in Delphi seems to be TMenuBarInfom and last parameter of GetMenuBarInfo is defined as Var-parameter. So I think I'll have to pass the whole record, not just pointer. function GetWindowMenuItemRect(const AHandle: THandle; const AIndex: Integer): TRect; var LMenuBarInfo: TMenuBarInfo; begin FillChar(LMenuBarInfo, SizeOf(LMenuBarInfo), 0); LMenuBarInfo.cbSize := SizeOf(LMenuBarInfo); {$WARN SYMBOL_PLATFORM OFF} Win32Check(GetMenuBarInfo(AHandle, Integer($FFFFFFFD), AIndex, LMenuBarInfo)); {$WARN SYMBOL_PLATFORM ON} Result.Top := LMenuBarInfo.rcBar.Top; Result.Left := LMenuBarInfo.rcBar.Left; Result.Height := LMenuBarInfo.rcBar.Height; Result.Width := LMenuBarInfo.rcBar.Width; end; It just gives me System Error. Code: 1400. Invalid window handle Tried to pass Windows Handle, MenuITems handle, did not Accept it... 😞 Weird. -Tee- -
Is there GIS library for delphi (Free or very cheap)
Tommi Prami replied to Tommi Prami's topic in Delphi Third-Party
Should have been little more clear. I would need to open vector maps, bitmap maps. And other geolocation data. do some drawing on the map etc. Preferably some code to make some analysis if needed. -tee- -
I think this comes (also) down to how expensive is getting Default Value. If just Constant or some simple value, then it is not an problem, But if it's anything more complicated, then it could be pretty slow if there is significant instances of other than default.
-
I Remember stumbling upon one long time ago but my Google-Fu was weak today. If not mistaken the lib I try to remember was integrated to Delphi iDE... MAybe... All info appreciated... -Tee-
-
I believe Embarcadero acquired rights to Ide FIX pack and changes are added to IDE it self, embarcadero only knows which ones and how tough... Andy is now trying to make DDevExtensions for Rio, but had some problems with debugging Ide bpls, I think I saw tweet yesterday. -Tee-
-
What is the fastest way to check if a file exists?
Tommi Prami replied to dummzeuch's topic in Windows API
Does that work with UNC paths? (Just asking) -
Report to Embarcadero Issuer tracker, and put link into here. So we can Vote on it.
-
Microsoft Windows Beta UTF-8 support for Ansi API could break things
Tommi Prami posted a topic in Windows API
Wiki Article of the Change https://en.wikipedia.org/wiki/Unicode_in_Microsoft_Windows#cite_note-10 One of out customer had selected that and we started to experience very weird problems and took some time to find out why it misbehaves. None of the application could connect to Firebird SQL server (Ours or third party) successfully. So would be smart to go through all tooling and code with that setting, we never know what M$oft will do with that, will it ever be released or will it soon be default for all. One coder switched this on and started to get weird results, he could not specify what all symptoms, but said that lot of work to be done before that setting can be enabled. Could be smart to Check how your environment, tools and code will behave. -
Microsoft Windows Beta UTF-8 support for Ansi API could break things
Tommi Prami replied to Tommi Prami's topic in Windows API
Sure is, but in other hand, why not use "Unicode API" at first place. I would guess they use Ansi API just as proxy to and from Unicode UTF16 API. SomeWindowsApiA -> String Conversion to UTF16 -> SomeWindowsApiAW Have not checked, just my hunch... In other hand If they have UTF-8 enabled API that is not just proxy to Wide API, then it could provide speed improvement if App uses UTF-8 strings. -
Aligned and atomic read/write
Tommi Prami replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Memspeed app by Primož, build with 10.2.3, Release mode, 32 and 64 bit versions, If any dares to download... MemSpeed.7z -
Aligned and atomic read/write
Tommi Prami replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Check out this fabulous book about memory alignment and performance. -
Creating Component Templates in Delphi
Tommi Prami replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Any idea where that saves the info, Registry maybe? Could be nice to make some syc-app that would sync all templates to all codes in the team. If needed... All would benefit and also properties would be unified also. without too much hassle. -Tee- -
Might be pretty difficult to make it but sometimes I've been pondering what would be quick way. Get screenshot of the Form Paint line(s) in order you'd like tabs go. Not best in all cases, but many it would be super fast. -Tee-
-
Does anyone have some library/unit to make coding of tokeniser/parser/somekind of tree easier?
Tommi Prami replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
OK, i'll rephrase 🙂 Any syntax chosen. Forgot abo8ut DelphiAST, that could be first stepping stone to look from. I've just been thinking that would be cool to study how it is done, and maybe do some small app in the process. -Tee- -
Does anyone have some library/unit to make coding of tokeniser/parser/somekind of tree easier?
Tommi Prami replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
More than less general. Any syntax basically... -
Pretty handy, also if it could remove the Delphi formattings so I could easily take SQL and paste it then to SQL tool to tinker with...
-
Once tried to do something like this on FMX, 1. Could not get it to look right 2. Was so much work. Memory of the process is very vague, tried to make some style thingy and use that. My observation was so that some things on Fmx are very complicated. Easier to make style than totally new VCL component with similar support build in, maybe. it depends I guess. Should give fmx a new change, do simple project with it. -Tee-