English
Forum

Mausabfrage Difference master- and Nebenfenster

 
- Page 1 -



Julian
Schmidt
Why functions The Mausabfrage in the Mainwindow so How tappt im dunkeln should and in the Nebenfenster first to verification of Enter?

code on Mainwindow:
CompileMarkSeparation
DEF GetDC(1) !"USER32","GetDC"
DEF CreateCompatibleDC(1) !"GDI32","CreateCompatibleDC"
DEF CreateCompatibleBitmap(3) !"GDI32","CreateCompatibleBitmap"
DEF SelectObject(2) !"GDI32","SelectObject"
DEF BitBlt(9) !"GDI32","BitBlt"
DEF GetCurrentObject(2) !"GDI32","GetCurrentObject"
DEF DeleteObject(1) "GDI32","DeleteObject"
DEF DeleteDC(1) !"GDI32","DeleteDC"
DEF ReleaseDC(2) !"USER32","ReleaseDC"

proc Screenshot

    Parameters xpos%,ypos%,maxX!,maxY!
    declare hdc&, hmdc&
    hdc& = GetDC(0)
    hmdc& = CreateCompatibleDC(hdc&)
    hbitmap& = CreateCompatibleBitmap(hdc&,maxX!,maxY!)
    SelectObject(hmdc&, hbitmap&)
    BitBlt(hmdc&, 0, 0, maxX!, maxY!, hdc&, xpos%, ypos%, $0CC0020)
    hbitmap& = GetCurrentObject(hmdc&, 7)
    DeleteDC(hmdc&)
    ReleaseDC(0,hdc&)

endproc

declare zaehler%, xpos%, ypos%, breite%, hoehe%, mod%,hbitmap&
Windowstyle 16+64
Window 0,0-0,0
ShowMax %hwnd
SetWindowPos %hwnd=99999999,99999999
Screenshot 0,0,%MaxX,%MaxY
SetWindowPos %hwnd=0,0
DrawPic hbitmap&, 0, 0; 0
UseCursor 3

while 1

    sleep 50

    if iskey(27)

        mod%=1
        Break

    Endif

    if %MousePressed

        zaehler%=zaehler%+1

        if zaehler%=1

            xpos%=%MouseX
            ypos%=%MouseY
            UsePen 0,2,RGB(255,0,0)
            Line %MouseX,0 - %MouseX,%MaxY
            Line 0,%MouseY - %MaxX,%MouseY
            sleep 100

        elseif zaehler%=2

            breite%=%MouseX-xpos%
            hoehe%=%MouseY-ypos%
            UsePen 0,2,RGB(255,0,0)
            Line %MouseX,0 - %MouseX,%MaxY
            Line 0,%MouseY - %MaxX,%MouseY

        Endif

    Endif

    case zaehler%=2 : Break

Endwhile

case mod%<>1 : Messagebox(Str$(xpos%)+","+Str$(ypos%)+"-"+Str$(breite%)+","+Str$(hoehe%),"",64
n> end

code on Nebenfenster:
CompileMarkSeparation
DEF GetDC(1) !"USER32","GetDC"
DEF CreateCompatibleDC(1) !"GDI32","CreateCompatibleDC"
DEF CreateCompatibleBitmap(3) !"GDI32","CreateCompatibleBitmap"
DEF SelectObject(2) !"GDI32","SelectObject"
DEF BitBlt(9) !"GDI32","BitBlt"
DEF GetCurrentObject(2) !"GDI32","GetCurrentObject"
DEF DeleteObject(1) "GDI32","DeleteObject"
DEF DeleteDC(1) !"GDI32","DeleteDC"
DEF ReleaseDC(2) !"USER32","ReleaseDC"

proc Screenshot

    Parameters xpos%,ypos%,maxX!,maxY!
    declare hdc&, hmdc&
    hdc& = GetDC(0)
    hmdc& = CreateCompatibleDC(hdc&)
    hbitmap& = CreateCompatibleBitmap(hdc&,maxX!,maxY!)
    SelectObject(hmdc&, hbitmap&)
    BitBlt(hmdc&, 0, 0, maxX!, maxY!, hdc&, xpos%, ypos%, $0CC0020)
    hbitmap& = GetCurrentObject(hmdc&, 7)
    DeleteDC(hmdc&)
    ReleaseDC(0,hdc&)

endproc

declare zaehler%, xpos%, ypos%, wide%, hoehe%, hbitmap&
Windowstyle 24
Window 100,200,500,500
CopyArea
end

Proc CopyArea

    declare mod%,zaehler%,infowindow&
    Windowstyle 16+64'$F0
    infowindow&=Create("Window",%hwnd,"",0,0,%MaxX,%MaxY)
    showwindow(infowindow&,0)
    Screenshot 0,0,%MaxX,%MaxY
    showwindow(infowindow&,1)
    startpaint infowindow&
    DrawPic hbitmap&, 0, 0; 0
    EndPaint
    UseCursor 3
    declare xpos%,ypos%,wide%,hoehe%

    while 1

        waitinput

        if iskey(27)

            mod%=1
            Break

        Endif

        'if %MousePressed
        zaehler%=zaehler%+1

        if zaehler%=1

            xpos%=%MouseX
            ypos%=%MouseY
            startpaint infowindow&
            USEP 0,2,RGB(255,0,0)
            Line %MouseX,0 - %MouseX,%MaxY
            Line 0,%MouseY - %MaxX,%MouseY
            EndPaint

        elseif zaehler%=2

            wide%=%MouseX-xpos%
            hoehe%=%MouseY-ypos%
            startpaint infowindow&
            USEP 0,2,RGB(255,0,0)
            Line %MouseX,0 - %MouseX,%MaxY
            Line 0,%MouseY - %MaxX,%MouseY
            EndPaint
            sleep 300

        Endif

        'Endif
        case zaehler%=2 : Break

    Endwhile

    UseCursor 1
    destroywindow(infowindow&)

    if mod%<>1

        Messagebox(Str $(xpos%)+","+Str $(ypos%)+"-"+Str $(wide%)+","+Str $(hoehe%),"",64)

    Endif

ENDPROC

 
˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
06/01/11  
 



« this Posting watts as Solution marked. »

If you UserMessage wm_lButtonDown or. 513 hinzufügst becomes WaitInput too with one Linksklick on the dialog leave.

gives too The User32::GetCursorPos API.
 
06/02/11  
 




Julian
Schmidt
calm it functions
thanks IF
CompileMarkSeparation
DEF GetDC(1) !"USER32","GetDC"
DEF CreateCompatibleDC(1) !"GDI32","CreateCompatibleDC"
DEF CreateCompatibleBitmap(3) !"GDI32","CreateCompatibleBitmap"
DEF SelectObject(2) !"GDI32","SelectObject"
DEF BitBlt(9) !"GDI32","BitBlt"
DEF GetCurrentObject(2) !"GDI32","GetCurrentObject"
DEF DeleteObject(1) "GDI32","DeleteObject"
DEF DeleteDC(1) !"GDI32","DeleteDC"
DEF ReleaseDC(2) !"USER32","ReleaseDC"

proc Screenshot

    Parameters xpos%,ypos%,maxX!,maxY!
    declare hdc&, hmdc&
    hdc& = GetDC(0)
    hmdc& = CreateCompatibleDC(hdc&)
    hbitmap& = CreateCompatibleBitmap(hdc&,maxX!,maxY!)
    SelectObject(hmdc&, hbitmap&)
    BitBlt(hmdc&, 0, 0, maxX!, maxY!, hdc&, xpos%, ypos%, $0CC0020)
    hbitmap& = GetCurrentObject(hmdc&, 7)
    DeleteDC(hmdc&)
    ReleaseDC(0,hdc&)

endproc

declare zaehler%, xpos%, ypos%, breite%, hoehe%, hbitmap&
Windowstyle 24
Window 100,200,500,500
CopyArea
end

Proc CopyArea

    declare mod%,zaehler%,infowindow&
    Windowstyle 16+64'$F0
    UserMessages 513
    infowindow&=Create("Window",%hwnd,"",0,0,%MaxX,%MaxY)
    showwindow(infowindow&,0)
    Screenshot 0,0,%MaxX,%MaxY
    showwindow(infowindow&,1)
    startpaint infowindow&
    DrawPic hbitmap&, 0, 0; 0
    EndPaint
    UseCursor 3
    declare xpos%,ypos%,breite%,hoehe%

    while 1

        waitinput

        if iskey(27)

            mod%=1
            Break

        Endif

        if %UMessage=513

            zaehler%=zaehler%+1

            if zaehler%=1

                xpos%=%MouseX
                ypos%=%MouseY
                startpaint infowindow&
                UsePen 0,2,RGB(255,0,0)
                Line %MouseX,0 - %MouseX,%MaxY
                Line 0,%MouseY - %MaxX,%MouseY
                EndPaint
                sleep 100

            elseif zaehler%=2

                breite%=%MouseX-xpos%
                hoehe%=%MouseY-ypos%
                startpaint infowindow&
                UsePen 0,2,RGB(255,0,0)
                Line %MouseX,0 - %MouseX,%MaxY
                Line 0,%MouseY - %MaxX,%MouseY
                EndPaint
                sleep 300

            Endif

        Endif

        case zaehler%=2 : Break

    Endwhile

    UseCursor 1
    destroywindow(infowindow&)

    if mod%<>1

        Messagebox(Str$(xpos%)+","+Str$(ypos%)+"-"+Str$(breite%)+","+Str$(hoehe%),"",64)

    Endif

ENDPROC

 
˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
06/02/11  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.418 Views

Untitledvor 0 min.
Rainer Hoefs07/02/19
rquindt12/02/15
H.Brill06/08/15
maroro06/12/14
More...

Themeninformationen

this Topic has 2 subscriber:

Julian Schmidt (2x)
iF (1x)


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