Recent

Author Topic: How can i run application in the panel ?  (Read 5657 times)

rvk

  • Hero Member
  • *****
  • Posts: 4672
Re: How can i run application in the panel ?
« Reply #15 on: May 18, 2022, 08:26:25 am »
How did you get the classname?
Like I said earlier, with a Windows spy program.

I used WinSpy.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=28220

Moombas

  • New Member
  • *
  • Posts: 38
Re: How can i run application in the panel ?
« Reply #16 on: May 18, 2022, 10:25:09 am »
Ah, sorry missed that.
Hmm, it seem that all Lazarus Programs have "Window" as class name, is there a (easy) way to change that for the own program?
The path is the destination but you should never lose sight of the destination on the way.

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 965
Re: How can i run application in the panel ?
« Reply #17 on: May 18, 2022, 10:30:57 am »
You can enumerate them as well, with the following functions (in unit Windows):

Code: Pascal  [Select][+][-]
  1. function EnumWindows(lpEnumFunc:ENUMWINDOWSPROC; lParam:LPARAM):WINBOOL; external 'user32' name 'EnumWindows';
  2. function GetWindowThreadProcessId(hWnd:HWND; lpdwProcessId:LPDWORD):DWORD; external 'user32' name 'GetWindowThreadProcessId';
  3.  

rvk

  • Hero Member
  • *****
  • Posts: 4672
Re: How can i run application in the panel ?
« Reply #18 on: May 18, 2022, 10:50:55 am »
Hmm, it seem that all Lazarus Programs have "Window" as class name, is there a (easy) way to change that for the own program?
Yes, Lazarus always uses "Window" as Class Name

(In Delphi it does have the same Class Name you used in your code)

The discussion about that is here:
https://forum.lazarus.freepascal.org/index.php/topic,15941.0.html

Moombas

  • New Member
  • *
  • Posts: 38
Re: How can i run application in the panel ?
« Reply #19 on: May 18, 2022, 03:37:13 pm »
Thanks for that, I'll take a look which way i go now.
I don't have so many LAzarus-applications here where this could be interessting now.

And regarding the Winbox i got fucked up because when it's connecting to a device it opens a completely new window which then appears outside of the application with the panel...
The path is the destination but you should never lose sight of the destination on the way.

rvk

  • Hero Member
  • *****
  • Posts: 4672
Re: How can i run application in the panel ?
« Reply #20 on: May 18, 2022, 03:42:58 pm »
And regarding the Winbox i got fucked up because when it's connecting to a device it opens a completely new window which then appears outside of the application with the panel...
Yeah, it's hard to contain program's that do that.

You could build in a timer which draws in every window with that classname.
If there are multiples you could put them in a TTabsheet for example.

And don't forget... if you end your program without closing the started app, the app will stay invisible in memory (so you would need to kill that too).

Moombas

  • New Member
  • *
  • Posts: 38
Re: How can i run application in the panel ?
« Reply #21 on: May 19, 2022, 08:12:46 am »
Yes, still noticed that and build in something to close the app (Form.Close/Form.Destroy/before i open an other Program).
Yeah a Timer could be a possible way to do that, I'll look out if maybe the classname is different or the same. But still a big thanks to you. I never would have tried just a simple "delay" to get it to work  %)
The path is the destination but you should never lose sight of the destination on the way.

 

TinyPortal © 2005-2018