Return after use of ReleaseMouse() ...

Just starting out? Need help? Post your questions and find answers here.
marc_256
Addict
Addict
Posts: 858
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Return after use of ReleaseMouse() ...

Post by marc_256 »

Hi,

After years of stand still ...
I'm restarting my [2D Gaming] educational program.
And starting with a geometrical course (see below)
Written in WIN PB [5.73x64] screen mode.

I want to temporarily exit my program with use of [ReleaseMouse()] control by pushing the [ALT] key.
to use an other program...

But how can I automatically return to my program after closing/minimizing the other program ?
and restore the exact mouse position after returning (see red arrow).

Is this possible with a [THREAD] program ?
Or is there a simple thing ?


thanks,
marc,


Image
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4996
Joined: Sun Apr 12, 2009 6:27 am

Re: Return after use of ReleaseMouse() ...

Post by RASHAD »

Hi
If you are a Windows user you can use

# 1 : Differnet window
SetFocus_(WindoID(#Window))
Or SetActiveWindow(#Window)
With SetWindowState(#Window, State)

# 2: Different Applications
hWnd = window application handle
SendMessage_(#HWND_BROADCAST, #WM_SYSCOMMAND, #SC_HOTKEY, hWnd)
Egypt my love
marc_256
Addict
Addict
Posts: 858
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Return after use of ReleaseMouse() ...

Post by marc_256 »

Hi RASHAD,

thanks for your help,

I gone try to store the mouse data before quitting my program,
and restoring the mouse data after
SetActiveWindow(#Window) or SetWindowState(#Window, State) return.

I want only use PB code for later conversion to Mac and Linux

marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply