anib Posted March 26, 2008 Posted March 26, 2008 expandcollapse popupstart: main proc LOCAL swid :DWORD LOCAL shgt :DWORD LOCAL dwid :DWORD LOCAL hDC :DWORD LOCAL cDC :DWORD LOCAL hScr :DWORD LOCAL hBmp :DWORD LOCAL hOld :DWORD mov hScr, 0 ; screen handle is zero mov hDC, rv(GetDC,hScr) ; get its DC mov swid, rv(GetSystemMetrics,SM_CXSCREEN) ; get screen width add eax, eax ; double it mov dwid, eax ; store it in a variable mov shgt, rv(GetSystemMetrics,SM_CYSCREEN) ; get the screen height mov hBmp, rv(CreateCompatibleBitmap,hDC,dwid,shgt) ; make double width bitmap mov cDC, rv(CreateCompatibleDC,hDC) ; create a DC for it mov hOld, rv(SelectObject,cDC,hBmp) ; select compatible bitmap into compatible DC ; ---------------------------------------- ; blit 2 copies of the current screen side ; by side onto the compatible bitmap. ; ---------------------------------------- invoke BitBlt,cDC,0,0,swid,shgt,hDC,0,0,SRCCOPY invoke BitBlt,cDC,swid,0,swid,shgt,hDC,0,0,SRCCOPY ; -------------------------------------------------------- ; repeatedly blit the shifting image to the current screen ; -------------------------------------------------------- push esi mov esi, swid @@: invoke BitBlt,hDC,0,0,swid,shgt,cDC,esi,0,SRCCOPY invoke Sleep, 20 ; slow it up a bit sub esi, 8 jns @B pop esi invoke SendMessage,0,WM_PAINT,hDC,0 ; clean up the mess after invoke DeleteObject,hBmp ; delete the compatible bitmap invoke SelectObject,cDC,hOld ; reselect the old one invoke DeleteDC,cDC ; delete the compatible DC invoke ReleaseDC,hScr,hDC ; release the screen DC exit main endp ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« end start expliquer moi thank a lot Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
Siao Posted March 26, 2008 Posted March 26, 2008 Is it really that hard? #include <WindowsConstants.au3> #include <WinAPI.au3> $hScreenDC = _WinAPI_GetWindowDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScreenDC) $hMemBMP = _WinAPI_CreateCompatibleBitmap($hScreenDC, @DesktopWidth*2, @DesktopHeight) _WinAPI_DeleteObject(_WinAPI_SelectObject($hMemDC, $hMemBMP)) _WinAPI_BitBlt($hMemDC, 0, 0, @DesktopWidth, @DesktopHeight, $hScreenDC, 0, 0, $SRCCOPY) _WinAPI_BitBlt($hMemDC, @DesktopWidth, 0, @DesktopWidth, @DesktopHeight, $hScreenDC, 0, 0, $SRCCOPY) For $i = @DesktopWidth To 0 Step -8 _WinAPI_BitBlt($hScreenDC, 0, 0, @DesktopWidth, @DesktopHeight, $hMemDC, $i, 0, $SRCCOPY) Sleep(20) Next _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE+$RDW_ALLCHILDREN) _WinAPI_ReleaseDC(0, $hScreenDC) _WinAPI_DeleteObject($hMemBMP) _WinAPI_DeleteDC($hMemDC) Exit "be smart, drink your wine"
anib Posted March 26, 2008 Author Posted March 26, 2008 (edited) yes ist very hard my translate, but don't functionnality#include <winapi.au3> #include <WindowsConstants.au3> Global $swid = _winapi_GetSystemMetrics($SM_CXSCREEN) Global $shgt = _winapi_GetSystemMetrics($SM_CYSCREEN) Global $dwid = $swid * 2 Global $hDC, $cDC, $hScr = 0, $hBmp, $hOld $hDC= _winapi_GetDC($hScr) $hBmp = _winapi_CreateCompatibleBitmap($hDC,$dwid,$shgt) $cDC = _winapi_CreateCompatibleDC($hDC) $hOld = _winapi_SelectObject($cDC,$hBmp) _winapi_BitBlt($cDC,0,0,$swid,$shgt,$hDC,0,0,$SRCCOPY) _winapi_BitBlt($cDC,$swid,0,$swid,$shgt,$hDC,0,0,$SRCCOPY) For $i = $swid to 0 step - 8 _winapi_BitBlt($hDC,0,0,$swid,$shgt,$cDC,$swid,0,$SRCCOPY) Sleep(20) next _SendMessage(0,$WM_PAINT,$hDC,0) _winapi_DeleteObject($hBmp) _winapi_SelectObject($cDC,$hOld) _winapi_DeleteDC($cDC) _winapi_ReleaseDC($hScr,$hDC) exitthank Siao your translate is perfect, greetBut function getdc => _WinAPI_GetWindowDCSendMessage is not necessaire?excuse me for my english, 'im difficult to speak (writing) thanks a lotps : rhaaa i'm to resolve my error ^__^ for $i = $swid to 0 step - 8 _winapi_BitBlt($hDC,0,0,$swid,$shgt,$cDC,$i,0,$SRCCOPY) Sleep(20)next Edited March 26, 2008 by anib Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
anib Posted April 1, 2008 Author Posted April 1, 2008 is not possible to inverse horizontal? #include <winapi.au3> #include <WindowsConstants.au3> Global $swid = _winapi_GetSystemMetrics($SM_CXSCREEN) Global $shgt = _winapi_GetSystemMetrics($SM_CYSCREEN) Global $dwid = $swid * 2 Global $hDC, $cDC, $hScr = 0, $hBmp, $hOld $hDC= _winapi_GetDC($hScr) $hBmp = _winapi_CreateCompatibleBitmap($hDC,$dwid,$shgt) $cDC = _winapi_CreateCompatibleDC($hDC) $hOld = _winapi_SelectObject($cDC,$hBmp) _winapi_BitBlt($cDC,0,0,$swid,$shgt,$hDC,0,0,$SRCCOPY) _winapi_BitBlt($cDC,0,0,$swid,$shgt,$hDC,$swid,0,$SRCCOPY) For $i = $swid to 0 step - 8 _winapi_BitBlt($hDC,$i,0,$swid,$shgt,$cDC,0,0,$SRCCOPY) Sleep(20) next _SendMessage(0,$WM_PAINT,$hDC,0) _winapi_DeleteObject($hBmp) _winapi_SelectObject($cDC,$hOld) _winapi_DeleteDC($cDC) _winapi_ReleaseDC($hScr,$hDC) exit Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
anib Posted April 5, 2008 Author Posted April 5, 2008 Excuse me, Questions concerning structures or even new function should be put in which party forum? Here or activx ? Thanks in advance. How can i Help ? please. Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
BrettF Posted April 5, 2008 Posted April 5, 2008 Excuse me, Questions concerning structures or even new function should be put in which party forum? Here or activx ? Thanks in advance.How can i Help ? please.Activx forum?? Never heard of it... AutoItX Forum I have though. If you are using a different language other than AutoIt with the AutoItX dll, then it goes there, other wise it can belong here... I think thats what you mean >.< Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
anib Posted April 5, 2008 Author Posted April 5, 2008 Thanks bert, I was not too sure, to ask the question in the right part of the forum. Is it possible to do the opposite effect than the one presented above? Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
covaks Posted April 5, 2008 Posted April 5, 2008 What do you mean the opposite effect? Move the screen the other way? If so, just look at the For loop. If "For $i = @DesktopWidth To 0 Step -8" moves it one way. Then "For $i = 0 to @DesktopWidth Step 8" should move it the other way.
anib Posted April 5, 2008 Author Posted April 5, 2008 Thank you covaks, I tried this formula, however, I am wrong somewhere,I thought it was necessary to use the second parameter bilblt: ( Eg: _winapi_BitBlt ($hDC, $i, 0, $swid, $shgt, $cDC, 0.0, $SRCCOPY)Thanks again Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
Malkey Posted April 6, 2008 Posted April 6, 2008 Modifications to Siao's example gives upwards movement. #include <WindowsConstants.au3> #include <WinAPI.au3> $hScreenDC = _WinAPI_GetWindowDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScreenDC) $hMemBMP = _WinAPI_CreateCompatibleBitmap($hScreenDC, @DesktopWidth, @DesktopHeight*2) _WinAPI_DeleteObject(_WinAPI_SelectObject($hMemDC, $hMemBMP)) _WinAPI_BitBlt($hMemDC, 0, 0, @DesktopWidth, @DesktopHeight, $hScreenDC, 0, 0, $SRCCOPY) _WinAPI_BitBlt($hMemDC, 0, @DesktopHeight, @DesktopWidth, @DesktopHeight, $hScreenDC, 0, 0, $SRCCOPY) For $i = 0 To @DesktopHeight Step 8 ;scroll Up ;For $i = @DesktopHeight To 0 Step -8 ;scroll Down _WinAPI_BitBlt($hScreenDC, 0, 0, @DesktopWidth, @DesktopHeight, $hMemDC, 0, $i, $SRCCOPY) Sleep(20) Next _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE+$RDW_ALLCHILDREN) _WinAPI_ReleaseDC(0, $hScreenDC) _WinAPI_DeleteObject($hMemBMP) _WinAPI_DeleteDC($hMemDC) Exit
anib Posted June 27, 2008 Author Posted June 27, 2008 thanks Malkey hello everybody is possible to help me for this ? bhwnd = True if(bhwnd || messagebox(....)==idok) ... my conversion is no good $bhwnd = true if ($bhwnd) then $reponse = msgbox(33,"title","text") if $reponse = 1 then ... How translate them || in autoit ? Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
Moderators SmOke_N Posted June 27, 2008 Moderators Posted June 27, 2008 It means "Or" for AutoIt. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
anib Posted June 27, 2008 Author Posted June 27, 2008 thanks Smoke_N $bhwnd = True if($bhwnd or msgbox(....)==1) ... but is not fonctionnel, dialogbox is not display I'm to change or to and (is correct ) $bhwnd = True if($bhwnd And msgbox(....)==1) ... thank you Me frappe pas !! je débute dans le monde du code :)Un novice avertit en vaut dix sans ennuie ;)AuToiT-FR
Moderators SmOke_N Posted June 27, 2008 Moderators Posted June 27, 2008 (edited) thanks Smoke_N $bhwnd = True if($bhwnd or msgbox(....)==1) ... but is not fonctionnel, dialogbox is not display I'm to change or to and (is correct ) $bhwnd = True if($bhwnd And msgbox(....)==1) ... thank youWhat are you talking about... you're making no sense at all. bhwnd = True if(bhwnd || messagebox(....)==idok) ... The code roughly translates to: $bhwnd = True If (($bhwnd) Or MsgBox(64, "info", "something here") = 1) Then Now the code above is quite redundant because MsgBox(number, title, text) ... if there is only an OK button, then "If" statement will ALWAYS be true. Where are you translating this code from? Edited June 27, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now