Purebasic Interacting with other windows?
Purebasic Interacting with other windows?
Is it possible for Purebasic to interact with a browser window, for example, a simple case where a PB program makes a Youtube window think someone is looking at the page every minute, so that it doesn't ask if you're still watching the videos, and cut off if you don't answer?
Re: Purebasic Interacting with other windows?
So your title is misleading.
You want explicit check a browser and not the title of any 'other' window.
This has nothing to do with windows.
It is more a tab text or string field from an other program.
I can give you hints for your original question in Linux.
Or do you mean an other OS
If so, which one.
And which browser ?
You want explicit check a browser and not the title of any 'other' window.
This has nothing to do with windows.
It is more a tab text or string field from an other program.
I can give you hints for your original question in Linux.
Or do you mean an other OS
If so, which one.
And which browser ?
Re: Purebasic Interacting with other windows?
infratec wrote: Sun Feb 04, 2024 7:21 pm So your title is misleading.
You want explicit check a browser and not the title of any 'other' window.
This has nothing to do with windows.
It is more a tab text or string field from an other program.
I can give you hints for your original question in Linux.
Or do you mean an other OS![]()
If so, which one.
And which browser ?
I want to get PB to interact with another window of a program on my PC. The title isn't misleading, that is what I want to do.
As an example of the type of thing I thought of to help describe what I aim for, I offered the broswer window interaction.
I'm using Windows and if the particular browser matters, let's say Mozilla Firefox.
I think something like
; Setting the mouse position.
SetCursorPos_(x,y)
; Simulating a left mouse click.
mouse_event_(#MOUSEEVENTF_LEFTDOWN,0,0,0,0)
mouse_event_(#MOUSEEVENTF_LEFTUP,0,0,0,0)
Would be sufficient, if I could make sure that the mouse will be under the control of PB while another window is active.
Re: Purebasic Interacting with other windows?
Don't mess with the mouse.
Change the idle state.
Change the idle state.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Purebasic Interacting with other windows?
Something like this:
Code: Select all
EnableExplicit
Define hWnd.i, Title$, Timeout.i, Rect.RECT
Timeout = 300
Repeat
hWnd = GetForegroundWindow_()
If hWnd
Title$ = Space(256)
If GetWindowText_(hWnd, @Title$, Len(Title$)) > 0
Debug Title$
EndIf
If GetWindowRect_(hWnd, @Rect)
Debug Str(rect\left) + "/" + Str(rect\top) + " " + Str(rect\right) + "\" + Str(rect\bottom)
EndIf
If DesktopMouseX() > rect\left And DesktopMouseX() < rect\right
If DesktopMouseY() > rect\top And DesktopMouseY() < rect\bottom
Debug "Inside"
SetCursorPos_(rect\right + 1, rect\top + 1)
Else
Debug "Outside"
EndIf
Else
Debug "Outside"
EndIf
EndIf
Delay(100)
Timeout - 1
Until Timeout = 0
Re: Purebasic Interacting with other windows?
Thanks, that lets me see which other window I am interacting with.
Re: Purebasic Interacting with other windows?
What other 'tools' does Purebasic have for interacting with other windows?
Can it 'see' pixels in them, the likes of Point(x,y), can it enter text like a keyboard entry?
Is there a set of commands I should be looking at?
Can it 'see' pixels in them, the likes of Point(x,y), can it enter text like a keyboard entry?
Is there a set of commands I should be looking at?
Re: Purebasic Interacting with other windows?
No.
PB can only access his own stuff with own commands.
If you want more, you have to use WIndows API stuff.
PB can only access his own stuff with own commands.
If you want more, you have to use WIndows API stuff.
Re: Purebasic Interacting with other windows?
Which part of the Programming reference for the Win32 API should I be looking under for those type of things?
Re: Purebasic Interacting with other windows?
Brilliant, thanks for those.


