Posted: Wed Dec 19, 2012 2:16 pm Post subject: Saw something interesting in main.lua
Hey,
I saw in main.lua
the following line
Code:
getForegroundProcess()
Its pretty awesome ...
I want to use it..
So I wrote this
Code:
function CEButton1Click(sender)
local proc=getForegroundProcess()
openProcess(proc)
end
createHotkey(CEButton1Click, VK_1)
Its working great.
But the thing is, I try to attach with google chrome.
And its attaching to the main processor (browser itself).
And I want to attach to the flash player..
I don't want to attach by getting processor ID.
But I do got a suggestion, can we attach to the processor that is being focused?
(In browser if you focused in a flash, ctrl+w won't shut down the tab, f11 won't go to full screen mode.. etc.)
It'll be pretty useful for me.
Thanks for reading.
EDIT:
I've got an alternative way.. by going to full screen mode in flashplayer, but the thing is that NOT all games let you go to fullscreen. _________________
I'm rusty and getting older, help me re-learn lua.
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
Posted: Thu Dec 20, 2012 10:26 am Post subject:
getForegroundProcess will only get the parent process that is focused. The control inside the browser is seen as a child and in most cases is not its own parent so 'getForegroundProcess' will not see it.
It is simply a wrapper around GetForegroundWindow so it does not do anything special to obtain the foreground process. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum