Author Topic: GetForegroundWindow and other  (Read 5611 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2264
    • Lazarus and Free Pascal italian community
GetForegroundWindow and other
« on: April 28, 2011, 02:15:16 pm »
Hello I am creating a program that uses GetForegroundWindow to figure out which window I'm currently using in an external program. But I also understand how I can compare it with the handle of my program. To prevent the two programs do not coincide. Does anyone have an idea?!
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Shebuka

  • Sr. Member
  • ****
  • Posts: 429
Re: GetForegroundWindow and other
« Reply #1 on: April 28, 2011, 02:37:45 pm »
Compare GetForegroundWindow with MainForm.Handle, both are integers.

btw i don't understand well your question...

xinyiman

  • Hero Member
  • *****
  • Posts: 2264
    • Lazarus and Free Pascal italian community
Re: GetForegroundWindow and other
« Reply #2 on: April 28, 2011, 02:42:02 pm »
Traveled road, but I SigSev returns error.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2264
    • Lazarus and Free Pascal italian community
Re: GetForegroundWindow and other
« Reply #3 on: April 28, 2011, 02:45:27 pm »
Or rather, on the main form as you said it works, but if I want to also identify the handle of a window invoked from the main window gives me the error sigsav.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018