Forum | | | | - page 1 - |
| Julian Schmidt | pourquoi funktioniert qui Mausabfrage im Hauptfenster so comment vous soll et im Nebenfenster seulement pour Bestätigung de Enter?
Code sur Hauptfenster: KompilierenMarqueSéparationDEF 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 sur Nebenfenster: KompilierenMarqueSéparationDEF 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
Paramètres 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
Fenêtre 100,200,500,500
CopyArea
end
Proc CopyArea
declare mod%,zaehler%,infowindow&
Windowstyle 16+64'$F0
infowindow&=Créer("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%
tandis que 1
waitinput
si iskey(27)
mod%=1
Pause
Endif
'si %MousePressed
zaehler%=zaehler%+1
si 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
cas zaehler%=2 : Pause
Endwhile
UseCursor 1
destroywindow(infowindow&)
si mod%<>1
Messagebox(Str$(xpos%)+»+Str$(ypos%)+"-"+Str$(breite%)+»+Str$(hoehe%),»,64)
Endif
ENDPROC
|
| | | ˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗ Webseite [...] | 01.06.2011 ▲ |
| |
| | « cette Beitrag wurde comme Solution gekennzeichnet. » | | | si Du UserMessage wm_lButtonDown bzw. 513 hinzufügst wird WaitInput aussi chez einem Linksklick sur den Dialog sortir de.
Gibt aussi qui User32::GetCursorPos API. |
| | | | | |
| | Julian Schmidt | Cool es funktioniert merci IF KompilierenMarqueSéparationDEF 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 ▲ |
| |
|
répondreOptions du sujet | 4.397 Views |
Themeninformationencet Thema hat 2 participant: |