Foro | | | | - Página 1 - |
| Julian Schmidt | ¿Por qué funktioniert el Mausabfrage en el Ventana principal como ellos se y en el Nebenfenster sólo después de Bestätigung de Enter?
Code en Ventana principal: KompilierenMarcaSeparaciónDEF 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 en Nebenfenster: KompilierenMarcaSeparaciónDEF GetDC(1) !"USER32","GetDC"
DEF CreateCompatibleDC(1) !"GDI32","CreateCompatibleDC"
DEF CreateCompatibleBitmap(3) !"GDI32","CreateCompatibleBitmap"
DEF Seleccionar objeto(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
Parámetros xpos%,ypos%,maxX!,maxY!
declarar hdc&, hmdc&
hdc& = GetDC(0)
hmdc& = CreateCompatibleDC(hdc&)
hbitmap& = CreateCompatibleBitmap(hdc&,maxX!,maxY!)
Seleccionar objeto(hmdc&, hbitmap&)
BitBlt(hmdc&, 0, 0, maxX!, maxY!, hdc&, xpos%, ypos%, $0CC0020)
hbitmap& = GetCurrentObject(hmdc&, 7)
DeleteDC(hmdc&)
ReleaseDC(0,hdc&)
ENDPROC
declarar zaehler%, xpos%, ypos%, breite%, hoehe%, hbitmap&
Windowstyle 24
Ventana 100,200,500,500
CopyArea
end
Proc CopyArea
declarar mod%,zaehler%,infowindow&
Windowstyle 16+64'$F0
infowindow&=Crear("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
declarar xpos%,ypos%,breite%,hoehe%
mientras que 1
waitinput
if iskey(27)
mod%=1
Romper
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
breite%=%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
caso zaehler%=2 : Romper
Endwhile
UseCursor 1
destroywindow(infowindow&)
if mod%<>1
Messagebox(Str$(xpos%)+","+Str$(ypos%)+"-"+Str$(breite%)+","+Str$(hoehe%),"",64)
Endif
ENDPROC
|
| | | ˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗ Webseite [...] | 01.06.2011 ▲ |
| |
| | « Dieser Contribución wurde como Solución gekennzeichnet. » | | | Si usted UserMessage wm_lButtonDown o. 513 hinzufügst se WaitInput auch en una Linksklick en el Diálogo verlassen.
Gibt auch el User32::GetCursorPos API. |
| | | | | |
| | Julian Schmidt | Cool lo funktioniert Gracias IF KompilierenMarcaSeparaciónDEF 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 [...] | 02.06.2011 ▲ |
| |
|
RespuestaThemeninformationenDieses Thema ha 2 subscriber: |