Forum | | | | - 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: CompileMarkSeparationDEF 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: CompileMarkSeparationDEF 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. |
| | | | | |
| | Julian Schmidt | calm it functions thanks IF CompileMarkSeparationDEF 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 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 2 subscriber: |