Move two borderless windows together [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Move two borderless windows together [Resolved]

Post by Kwai chang caine »

Hello at all

Have you a way for say to the "window_1" she must mooving with the mouse only if she have the focus ?

Code: Select all

OpenWindow(0, 100, 100, 400, 310, "Window 1", #PB_Window_BorderLess)
TextGadget(0, 0, 0, 400, 20, "Window_1")
OpenWindow(1, 600, 100, 400, 310, "Window 2", #PB_Window_BorderLess)
TextGadget(1, 0, 0, 400, 20, "Window_2")

Repeat 
 
 Event = WaitWindowEvent()
 
 If Event = #WM_MOUSEMOVE
 
  If IsWindow(0)
   SendMessage_(WindowID(0), #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
  EndIf
  
  If IsWindow(1)
   SendMessage_(WindowID(1), #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
  EndIf
  
 EndIf  
 
Until GetAsyncKeyState_(#VK_ESCAPE)
Have a good day
Last edited by Kwai chang caine on Wed Nov 29, 2023 7:29 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: Move two borderless windows together

Post by Mijikai »

Code: Select all

OpenWindow(0, 100, 100, 400, 310, "Window 1", #PB_Window_BorderLess)
TextGadget(0, 0, 0, 400, 20, "Window_1")
OpenWindow(1, 600, 100, 400, 310, "Window 2", #PB_Window_BorderLess)
TextGadget(1, 0, 0, 400, 20, "Window_2")
Repeat 
 
 Event = WaitWindowEvent()
 
 If Event = #WM_MOUSEMOVE
 
   SendMessage_(WindowID(EventWindow()), #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
  
 EndIf  
 
Until GetAsyncKeyState_(#VK_ESCAPE)
Last edited by Mijikai on Thu Nov 30, 2023 5:18 pm, edited 1 time in total.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Move two borderless windows together

Post by Kwai chang caine »

Hello MASTER, happy to read you :D

Wahoouuuu !!!!!!
too strong !!!! :shock:


That works perfectly, and it's exactely what i search to do since one hour, never i found the solution without your precious help :oops:

One thousand of thanks
Have a very nice end of day 8)
ImageThe happiness is a road...
Not a destination
BarryG
Addict
Addict
Posts: 4272
Joined: Thu Apr 18, 2019 8:17 am

Re: Move two borderless windows together [Resolved]

Post by BarryG »

The title says "move two borderless windows together", but the code above only moves one when I move it with the mouse?
normeus
Enthusiast
Enthusiast
Posts: 485
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: Move two borderless windows together [Resolved]

Post by normeus »

Grasshopper, if you place a window on top of a window, are they not together?

Actually KCC's original code only window 1 would move, with Mijikai's code you click on the window that needs moving and it moves.
I blame it on google translate, she's a harsh mistress she be.

Norm
P.S.
I always enjoy KCC's posts,they are so random. I could never guess what he is working on.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
User avatar
jacdelad
Addict
Addict
Posts: 2046
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Move two borderless windows together [Resolved]

Post by jacdelad »

normeus wrote: Thu Nov 30, 2023 6:26 am P.S.
I always enjoy KCC's posts,they are so random. I could never guess what he is working on.
...and he's always excited like a 5 year old getting ice cream. :mrgreen:
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Move two borderless windows together [Resolved]

Post by Kwai chang caine »

Hello at all :D
jacdelad wrote:...and he's always excited like a 5 year old getting ice cream.
You have right :wink:
Since several decade, i know PB, I never recovered the day where i see the real power of the programmation :shock:
In fact, for me this simple and a little bit sad yellow window opened the first time, apparently without interest first on board, made me think at the movie "Ali Baba And The Forty Thieves" :|

The first contact are like if i show the sad door :|

Image

And when i enter in the forum, the wonderful numerous Genies, give immediately to me, the password "Sesame ouvre toi" and showed me and even better... gave me...

Image

all these splendids treasures

Image

that they had within them. :shock:

I know that no one believes me, and someone very often thinks, that I am doing too much. :?

But I swear to you, on what is dearest to me, that very often, seeing a MASTER of programming take his precious time, even if it's only 3 minutes, to help a keyboard larva like me, and well. .. it makes me happy and sometimes even brings tears to my eyes.
I don't know how to communicate this happiness and make this person understand the value that this help has for me, and above all try to make them feel the recognition and admiration that I have towards them.Image

And how can I make someone who has mastered the most complicated things in programming understand the value it has in my eyes, when for him, everything is “simple” and “doable” :shock: whereas for KCC just opening the IDE and creating a bug-free window is an achievement :lol:
And the crazy thing about this story, is that all these years, I should have gotten used to this feeling. :shock:
Well no, the effect is still intact for certain aids, for which I worked several hours without success, and a MASTER with a return hand gives me the solution which will unblock my project. 8)

Once again, I've said it often, I'm not too much fan of any star like many people are. :oops:
For me, no Bruce Springsteen, John Wayne, Brithney Spears, Michael Jackson, etc...
Although I really like Michael Jackson and admire him, my admiration has no measure with that of a GRAND MASTER like FRED and his team, or certain MASTERS that I come across on this forum, and also Kevin Mitnick and all the man also than him.
A man so good at computers that he was condemned never to touch a keyboard for fear that he might disrupt a system. :shock:
KCC could also be condemned to the same thing...but without doing it on purpose :oops: :mrgreen:

So what would you do in my place if you could write and communicate with the people you admire most in the world ?
what you would say to your superhero ? :oops:
and what's more, if he have the generosity to take an interest in you and help you ?
Furthermore, my superheroes often live in other countries, and I love other countries, their languages (even if I don't understand it :oops: ) and their customs 8)
PB is more strong than FaceBook..thanks to him i have virtual friends in the four corners of the planet, always ready for help me :shock: 8)

So... this is the explanation of the KCC attitude.... which often surprises me myself :shock:
And his reaction to an ice cream like a child :wink:
Normeus wrote:I always enjoy KCC's posts,they are so random. I could never guess what he is working on.
You have really right too :oops:
Following this discovery of the treasures of programming, explained above.
And understanding that my MASTERS were capable of almost anything. :shock:
But then ??? everything is possible with PB ??? :shock:

My sick and above all incapable brain, had one idea per day, to try to simplify life and modify certain behaviors of the machines, which were unbearable to me. :?
And it is for this reason that, despite my inability, I do not think that a single area of ​​the world of programming has not been visited by KCC, thanks to the precious help of all my superheros 8)
Hundreds of programs more incomplete than finished are in my archives and for which I often no longer have the time and especially no knowledge to finish them. :oops:
I keep them preciously because I, like you, have spent thousands of hours and they are my babies, and I always have the hope of completing them one day even though the end is getting closer and closer. :cry:

Although it seems like nonsense, and I ask questions in every direction, I swear to you again that none of my hundreds of questions has ever been the result of a project sometimes crazier than realistic :wink:

@All
In all cases....thanks a lot for your interest and help 8) to a microb of the programming :oops:

Have a very very good end of years

Image

I love you MASTERS and friends of this familly forum

Litte KCC, your fan for the eternity 8)
ImageThe happiness is a road...
Not a destination
Fred
Administrator
Administrator
Posts: 18396
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Move two borderless windows together [Resolved]

Post by Fred »

That was a while we didn't had a KCC signature post ! :lol: :lol:
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Move two borderless windows together [Resolved]

Post by Kwai chang caine »

Hello God of the MASTERS :D

When i have see your serene red pseudo "Fred" :shock:
I felt a blow to my heart, and I said to myself:

"Ayaiii!!! I'm going to get yelled at again" with my table-extending posts :oops: :oops:

So... it must already be the time of Christmas miracles

Image

because i'm wrong and furthermore... I have the honor of having my God

Image

who writing to me, even if it were just a few words :shock:
I will print this line and frame it immediately :lol:

Thank you GRAND MASTER for this kind message to your humble fan and servant :oops: and obviously for everything since this several decade
And no need to tell you if i love you....you :mrgreen:

I wish you and all your team

Image

the happiest end of year,
of all the ends of the year, in the world
8)
ImageThe happiness is a road...
Not a destination
User avatar
jacdelad
Addict
Addict
Posts: 2046
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Move two borderless windows together [Resolved]

Post by jacdelad »

Kwai chang caine wrote: Thu Nov 30, 2023 4:10 pm I will print this line and frame it immediately :lol:
Proof or it didn't happen! :D
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: Move two borderless windows together [Resolved]

Post by Mijikai »

Master KCC, i made a mistake in the solution :oops:
The two PostMessage_() calls at the beginning are not needed (left over from testing).
I corrected the post and wish you a wonderful end of the year and all the best for the next :D
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5528
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Move two borderless windows together [Resolved]

Post by Kwai chang caine »

Mijikaï wrote:Master KCC, i made a mistake in the solution
Hello MASTER....you mainly made a mistake in "Master KCC" :shock: :lol:

You have right, it's again more simple now and works always perfectly :shock:
You are again more strong ...with 2 lines less :mrgreen:

Have a very end of the year you two 8)
ImageThe happiness is a road...
Not a destination
Post Reply