English
Source / code snippets

several monitors Workarea

 

Georg
Teles
is The Extension [...] 
CompileMarkSeparation
'###########################################
'#                                         #
'#  Snippet von Georg Teles am 09.10.2014  #
'#                                         #
'###########################################
 $H Windows.ph
Def GetMonitorInfoA(2)!"user32","GetMonitorInfoA"
Def MonitorFromWindow(2)!"user32","MonitorFromWindow"
Def GetAsyncKeyState(1) ! "user32.dll","GetAsyncKeyState"
Struct RECT = left&,top&,right&,bottom&
Declare rcMonitor#, rcWork#
Dim rcMonitor#, RECT
Dim rcWork#, RECT
STRUCT MONITORINFO = cbSize&, rcMonitor#(16), rcWork#(16), dwFlags&
Declare mon#
Dim mon#, MONITORINFO
mon#.cbSize& = SizeOf(mon#)
CLS
' Information das erste mal in mon# einlesen
GetMonitorInfoA(MonitorFromWindow(%HWnd,2),mon#)' für OK gibt 1 zurück, 0 = Fehler
info()
Usermessages $201

While 1

    Waitinput
    Case %UMessage=$201 : movebymouse()
    info()

EndWhile

Dispose rcWork#
Dispose rcMonitor#
Dispose mon#

Proc movebymouse

    Parameters m&
    Declare mpos#, x1&, y1&
    Dim mpos#,8
    ~GetCursorPos(mpos#)
    var wix&=%winLeft-long(mpos#,0)
    var wiy&=%winTop-long(mpos#,4)

    While iskey(1)

        Sendmessage(%hwnd,$0112,$0F012,0)

    EndWhile

    ' deren (vom aktiven Monitor) Workarea ermitteln erst nachdem das Fenster auf diesen Monitor verschoben wurde
    GetMonitorInfoA(MonitorFromWindow(%HWnd,2),mon#)
    ~GetCursorPos(mpos#)
    x1&=(long(mpos#,0)+wix&)
    case x1&<workarea("Links") : x1&=workarea("Links")
    case x1&>workarea("Rechts")-(%winRight-%winLeft) : x1&=workarea("Rechts")-(%winRight-%winLeft)
    y1&=(long(mpos#,4)+wiy&)
    case y1&<workarea("Oben") : y1&=workarea("Oben")
    case y1&>workarea("Unten")-(%winBottom-%winTop) : y1&=workarea("Unten")-(%winBottom-%winTop)
    setWindowPos %hWnd=x1&,y1& - (%winRight-%winLeft),(%winBottom-%winTop);0
    Dispose mpos#

EndProc

Proc workarea

    Parameters position$
    Declare x%
    case position$="Links":x%=Long(mon#,20)
    case position$="Oben":x%=Long(mon#,24)
    case position$="Rechts":x%=Long(mon#,28)
    case position$="Unten":x%=Long(mon#,32)
    Return x%

EndProc

Proc info

    CLS
    print "cbSize&: ";Long(mon#,0)
    print
    print "hMon X: (left)   - ";Long(mon#,4)
    print "hMon Y: (top)    - ";Long(mon#,8)
    print "hMon W: (right)  - ";Long(mon#,12)
    print "hMon H: (bottom) - ";Long(mon#,16)
    print
    print "WORK X: (left)   - ";Long(mon#,20)
    print "WORK Y: (top)    - ";Long(mon#,24)
    print "WORK W: (right)  - ";Long(mon#,28)
    print "WORK H: (bottom) - ";Long(mon#,32)
    print
    print "dwFlags&:";Long(mon#,362>)

ENDPROC

 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/09/14  
 



Yes something like is always very nice.

Perhaps. as Tipp with something like:
CompileMarkSeparation
Proc workarea

    Parameters position$
    Declare x%
    case position$="Links":x%=Long(mon#,20)
    case position$="Oben":x%=Long(mon#,24)
    case position$="Rechts":x%=Long(mon#,28)
    case position$="Unten":x%=Long(mon#,32)
    Return x%

c

plainer always too for processor (means energiesparender):
CompileMarkSeparation
Proc workarea

    Parameters pos&// 0L;1O;2R;3u
    return long(mon#,20+pos&*4)

endproc


or. for Xpsenutzer:
CompileMarkSeparation
workarea(long p){return long(mon#,20+p*4)}

or nProc:
CompileMarkSeparation
should heissen that it itself with such aneinanderhängenden Speicherplätzen well anbietet with a factor cheap directly To address.

must one net, can but.
 
10/10/14  
 




Georg
Teles
One friend said me as it my Codes seen having (PHP), at program as much as possible To to comment & auszuschreiben, Übersichts- & Verständlichkeitshalber for others Programmer, it power it too professional & it works several people in a proposition. the was but here unnecessary Nebeninfo have simply to the Solution for several monitors sought & for others nachvollziehbar umschrieben How in the previous Workarea or. from Laziness let ... all joking aside

Yes the bid itself In any accrue, The xpse Variante gefällt me best.

be too the opinion so little How possible To write & plenty How possible abzukürzen, with finished Programs entferne I even vain zeilen, Tabs & space
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/10/14  
 



Georg Teles (10.10.14)
with finished Programs entferne I even vain zeilen, Tabs & space


Irghh.

the tätentut the xpse in the "enh"-File The it to that XProfan-Kompilierer gives.

I promise me not against comments in the fountain from separate sooner against
"unnötigen" Prozessoraufwand beziehungsweise against little-effizienten code.

with functions as here with the Workarea is the presumably wumpe since the function
vmtl. hardly regularly called becomes.

wished too only bisl Klugscheißen, make I regularly - Profilneurosen.
 
10/10/14  
 




Georg
Teles
( I said indeed unnecessary of me Info, the first set ) I entferne The Lines because I with XPSE only kompiliere, if it circa nProc's goes ... Yes there have you got right, from little How possible as much as possible herauszuholen & elegant How possible formulieren, is the art in the program ( & optimiert is it Yes then automatically or = optimiert, then is it perfect )
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/10/14  
 



perfect Better get going never.

though the again too to such one set How sounds like the there sounds: "weltweiter want on homecomputern max 5" -

not even with the testimony the one itself always irrt can not brill
 
10/10/14  
 




Georg
Teles
If one itself 100% sure is can itself nevertheless brill, the is correct ... our Physiklehrer said time: "wenn I The hand to my face stops, be I I do not sure, whether between my eyes and the hand nothing (not breeze meant) is, because I see only the, what my eyes me zeigen"

severe taken are zB. physikalische Gesetzte Annäherungen on The truth through Kalkulation, sometimes based on Beobachtungen, analysis, Auswertung, ... of assembled data --- with menschlichen Emotionen can the word "Cool" a integrally others weight & Empfindungen with you herforrufen as by me or anyone else, even if one situationally it correctly. aufnimmt, can it To Missverständnissen lead if man it exactly takes

perfect was code diction of me, it'll objectively nothing perfect his
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/10/14  
 



there isser again the bow:

Georg Teles (10.10.14)
it'll objectively nothing perfect his


the perfect is perfect!
 
10/10/14  
 




Georg
Teles
would there the word go stand, were it no bow:

it'll objectively nothing perfect go

I give to, the perfect is (already) perfect & becomes furthermore perfect his
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/11/14  
 



Georg Teles (11.10.14)
... & becomes furthermore perfect his


are we now means successful in the country the Spekulationen arrived?
 
10/11/14  
 




Georg
Teles
shining so To his
 
XProfan X2
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

10/12/14  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

15.510 Views

Untitledvor 0 min.
Georg Teles08/29/24
Torsten Boo06/09/22
RudiB.02/07/22
p.specht11/20/21
More...

Themeninformationen

this Topic has 2 subscriber:

Georg Teles (6x)
iF (5x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie