Page 1 of 1
get the window handle to other language
Posted: Fri Dec 17, 2004 7:48 pm
by porfirio
hi ! i want to know how i use pb functions in oher program windows i search in rhe forum and i found this code:
Code: Select all
handle=FindWindow_(0,"FullTitleGoesHere")
but i don't know how to use it for exemple i want to create a dll to crate a button in the other program window should i make this :
handle=FindWindow_(0,"FullTitleGoesHere")
If OpenWindow(handle, 364, 175, 600, 300, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
If CreateGadgetList(WindowID())
ButtonGadget(0, 15, 15, 75, 45, "")
EndIf
EndIf
but that don't work ..
the program that i am using have a function called"window_handle()" many dll i know for this program the ppl when call the dll for crete a window or webgadjet call this function
please help i'm geting frustrated
8O
Re: get the window handle to other language
Posted: Sat Dec 18, 2004 7:49 am
by PB
What you're asking (adding gadgets to external apps) is very advanced and
not easy to do. I, for example, don't know how to do it -- but nor do I have
any need to. What do you want to do anyway? Maybe there's another way
to do it, without adding gadgets...?
profram to systray
Posted: Sat Dec 18, 2004 9:56 am
by porfirio
i want to put the other program in systray hide his window and put a icon on systray and have a comand to show window again
please help
Posted: Fri Dec 24, 2004 9:52 am
by porfirio
someone know how to do it please help
Posted: Fri Dec 24, 2004 2:22 pm
by Henrik
Why not just let your program hide the other prg. and then send your prg. to systray, and from your prg. in systray you can show the other program again on command.
If this does'nt make sens it's because i'm danish 8O
*Edit*
ShowWindow_(Handler,#SW_HIDE)
ShowWindow_(Handler,#SW_SHOW)
Best regrads
Henrik
i will try
Posted: Fri Dec 24, 2004 5:16 pm
by porfirio
Henrik wrote:Why not just let your program hide the other prg. and then send your prg. to systray, and from your prg. in systray you can show the other program again on command.
If this does'nt make sens it's because i'm danish 8O
*Edit*
ShowWindow_(Handler,#SW_HIDE)
ShowWindow_(Handler,#SW_SHOW)
Best regrads
Henrik
i will try thanks
Posted: Wed Jun 29, 2005 3:51 am
by Intrigued
This topic interests me as well. I have an external application I have created in an application (that uses LUA) that I wanted to do the same thing with as the previous poster is trying to get done.
I have been kicking this around for a couple weeks, but I keep letting myself get sidetrack with all the "chrome" of PB. It's a lot of fun, but one does have their work cut out to make a go of PB. (it's worth it for sure!)
[UPDATE]
I did have success tonight besides going blindly into the night.

Posted: Wed Jun 29, 2005 9:26 am
by porfirio
Intrigued wrote:This topic interests me as well. I have an external application I have created in an application (that uses LUA) that I wanted to do the same thing with as the previous poster is trying to get done.
I have been kicking this around for a couple weeks, but I keep letting myself get sidetrack with all the "chrome" of PB. It's a lot of fun, but one does have their work cut out to make a go of PB. (it's worth it for sure!)
[UPDATE]
I did have success tonight besides going blindly into the night.

Somehow i have founded a way to do it

Re: get the window handle to other language
Posted: Wed Jun 29, 2005 3:23 pm
by Trond
PB wrote:What you're asking (adding gadgets to external apps) is very advanced and
not easy to do. I, for example, don't know how to do it -- but nor do I have
any need to. What do you want to do anyway? Maybe there's another way
to do it, without adding gadgets...?
What?? Very advanced?? You must be kidding! When creating a gadget list, you are asked for a window id. If you pass the OS window id of your application (f.ex. made in C/Delphi/etc...) the gadgets will, without problems be created in the other window. What's the problem? (Just disable the debugger.)
Re: get the window handle to other language
Posted: Thu Jun 30, 2005 9:33 am
by porfirio
Trond wrote:PB wrote:What you're asking (adding gadgets to external apps) is very advanced and
not easy to do. I, for example, don't know how to do it -- but nor do I have
any need to. What do you want to do anyway? Maybe there's another way
to do it, without adding gadgets...?
What?? Very advanced?? You must be kidding! When creating a gadget list, you are asked for a window id. If you pass the OS window id of your application (f.ex. made in C/Delphi/etc...) the gadgets will, without problems be created in the other window. What's the problem? (Just disable the debugger.)
That is exacly what i have done!!!
Re: get the window handle to other language
Posted: Thu Jun 30, 2005 10:26 am
by PB
> What?? Very advanced?? You must be kidding!
Can you please show me how, then? I tried this and it didn't work:
Code: Select all
c=FindWindow_(0,"Calculator")
CreateGadgetList(c)
ButtonGadget(0,0,0,100,20,"test")
Posted: Thu Jun 30, 2005 12:25 pm
by Trond
I think your problem is that you don't allow the button draw itself. Actually I haven't found out how to catch events yet, but that shouldn't be impossible.
I'm hard-coding the WindowID for each run:
Code: Select all
WindowID = 13173870
CreateGadgetList(WindowID)
ButtonGadget(0,10,15,60,30,"Test button")
Repeat : WaitWindowEvent()
ForEver
Be sure to close your app using the task manager after finished!!
Another approach would be to make a normal borderless PB window and set it as child of the other window.
Posted: Thu Jun 30, 2005 12:48 pm
by porfirio
i have losted the code but i have made once a code that on mouse click on window it just create a button on it
something like this
CreateGadgetList(GetForegroundWindow_())
ButtonGadget(0,10,15,60,30,"Test button")