Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/28/2017 in all areas

  1. You can try this hack, keeping in mind that .INI format was never intended to store bulk text: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) $hEDIT = GUICtrlCreateEdit("",11,11,600,400) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### IniWrite("JustATest.ini","TestSec","TestKey",'"TestValue " & @CRLF & "Testing" & @LF & "test"') $sData = Execute('"' & IniRead("JustATest.ini","TestSec","TestKey","") & '"') GUICtrlSetData($hEDIT,$sData) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    2 points
  2. That would take a miracle to be ever true My wife wouldn't agree... but she has a particular way of thinking
    2 points
  3. Kip

    TCP UDF, Event driven!

    Hey, Because people always ask how to create a TCP client/server, and then (if they get it) don't know how to make it multi client, I simplified it. It's event driven, so you don't have to manualy check everything. Please read this whole post to understand my UDF. Version 3 of this UDF: Functions renamed, and everything is event-driven. Functions: _TCP_Server_Create($iPort, $sIP="0.0.0.0") _TCP_Server_Broadcast($sData) _TCP_Server_ClientList() _TCP_Server_ClientIP($hSocket) _TCP_Server_DisconnectClient($hSocket) _TCP_Server_Stop() _TCP_Client_Create($sIP , $iPort) _TCP_Client_Stop($hSocket) _TCP_Send($hSocket, $sText) _TCP_RegisterEvent($hSocket, $iEvent, $sFunction) Use _TCP_RegisterEvent() to register an event. These are the possible events to register: $TCP_SEND - When the other side of the connection is ready to receive (more) data. $TCP_RECEIVE - If something is received. $TCP_CONNECT - When you connect to the server. (Client only) $TCP_DISCONNECT - When a connection is closed. $TCP_NEWCLIENT - When a new client connects to the server. (Server only) Example client: #include "TCP.au3" ToolTip("CLIENT: Connecting...",10,10) $hClient = _TCP_Client_Create(@IPAddress1, 88); Create the client. Which will connect to the local ip address on port 88 _TCP_RegisterEvent($hClient, $TCP_RECEIVE, "Received"); Function "Received" will get called when something is received _TCP_RegisterEvent($hClient, $TCP_CONNECT, "Connected"); And func "Connected" will get called when the client is connected. _TCP_RegisterEvent($hClient, $TCP_DISCONNECT, "Disconnected"); And "Disconnected" will get called when the server disconnects us, or when the connection is lost. While 1 ; just to keep the program running WEnd Func Connected($hSocket, $iError); We registered this (you see?), When we're connected (or not) this function will be called. If not $iError Then; If there is no error... ToolTip("CLIENT: Connected!",10,10); ... we're connected. Else; ,else... ToolTip("CLIENT: Could not connect. Are you sure the server is running?",10,10); ... we aren't. EndIf EndFunc Func Received($hSocket, $sReceived, $iError); And we also registered this! Our homemade do-it-yourself function gets called when something is received. ToolTip("CLIENT: We received this: "& $sReceived, 10,10); (and we'll display it) EndFunc Func Disconnected($hSocket, $iError); Our disconnect function. Notice that all functions should have an $iError parameter. ToolTip("CLIENT: Connection closed or lost.", 10,10) EndFunc And the server: (which is smaller than the client) #include "TCP.au3" ToolTip("SERVER: Creating server...",10,30) $hServer = _TCP_Server_Create(88); A server. Tadaa! _TCP_RegisterEvent($hServer, $TCP_NEWCLIENT, "NewClient"); Whooooo! Now, this function (NewClient) get's called when a new client connects to the server. _TCP_RegisterEvent($hServer, $TCP_DISCONNECT, "Disconnect"); And this,... this will get called when a client disconnects. While 1 WEnd Func NewClient($hSocket, $iError); Yo, check this out! It's a $iError parameter! (In case you didn't noticed: It's in every function) ToolTip("SERVER: New client connected."&@CRLF&"Sending this: Bleh!",10,30) _TCP_Send($hSocket, "Bleh!"); Sending: "Bleh!" to the new client. (Yes, that's right: $hSocket is the socket of the new client.) EndFunc Func Disconnect($hSocket, $iError); Damn, we lost a client. Time of death: @Hour & @Min & @Sec :P ToolTip("SERVER: Client disconnected.",10,30); Placing a tooltip right under the tooltips of the client. EndFunc Now, as you can see, every function has an $iError parameter. Function($hSocket, $iError) Every funtion that is called can contain two parameters (1st: Socket, 2nd: Error) except for the Received function. Which should contain 3 parameters. 1:Socket, 2:Data, 3:Error You can't create a server and a client in the same script. Well, I think that's all. Happy coding Kip Previous number of downloads: 975 TCP.au3
    1 point
  4. Jos

    Server-Client (VPN)

    Nope, The VPN tunnel is between the client (youyr pc) and server (VPN provider), so the portforarding will have to be at the provider side! Understand, and that is one of the reasons I have a VPN server at home, which allows me to look at the Television programs anywhere in the world. But this is Outbound traffic which isn't a problem with these NAT type sharing solutions. Jos
    1 point
  5. Jos

    Server-Client (VPN)

    Again that depends on what you are trying to do. Do you need inbound sessions to a service running on your computer or outbound sessions since you are talking about opening ports on the router? Same question: Do they support inbound connections which I guess you are trying to do? When sharing the same External IP with multiple clients, you have to be able to control the defined NAT at the providers side and play with NATing specific ports to be able to map them back to a single client. OpenVPN and PPTP are just tyles of tunnels which connect to a VPN server, which is only a part of the connection when using a VPN service to hide your ass. So what exactly are you trying to accomplish here? Jos
    1 point
  6. Jos

    Server-Client (VPN)

    I am totally lost when it comes to the scenario for VPN you describe. To me a VPN tunnel is nothing more or less that an end-to-end IP connection which allows you to route (all) ip traffic through it depending whether it is a closed or open (split) tunnel. It acts like a NIC and has it's own IP address,, netmask and Gateway. When you are talking about an HideMyAss type of VPN solution, it should simply route all IP traffic through the providers proxy servers to hide your own source IP address. So, where does this UDP 53 port come into play as that one is normally used for DNS but also known for trojan type activity? Jos
    1 point
  7. Here you go... Copy this source into a *.nsi file and store it in the same directory as the standard SciTE4AutoIt3 installer. Compile this *.nsi file with NSIS and you should have an installer that runs silent and start the SciTE4AutoIt3 with /S and then updates the registry to Edit. Ask if anything is unclear. Jos ; Script generated by the HM NIS Edit Script Wizard. SetCompressor /SOLID lzma ; Script generated by the HM NIS Edit Script Wizard. !define PRODUCT_NAME "SciTe4Autoit3 silent install wrapper" !define PRODUCT_VERSION "1.0" !define PRODUCT_PUBLISHER "Jos van der Zande" !define PRODUCT_WEB_SITE "http://www.autoitscript.com/autoit3/scite" ; MUI 1.67 compatible ------ !include "MUI.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" ; Welcome page !insertmacro MUI_PAGE_WELCOME ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page !insertmacro MUI_PAGE_FINISH ; Language files !insertmacro MUI_LANGUAGE "English" ; MUI end ------ SilentInstall silent Section "MainSection" SEC01 SetOverwrite on SetOutPath "$TEMP" File "SciTE4AutoIt3.exe" DetailPrint "*** Running installer ***" ExecWait '"$TEMP\SciTE4AutoIt3.exe" /S' DetailPrint "*** set Edit as default for .au3 ***" WriteRegStr HKCR "AutoIt3Script\Shell\" "" "Edit" WriteRegStr HKCR "AutoIt3ScriptBeta\Shell\" "" "Edit" DetailPrint "*** Installer done ***" sleep 2000 delete "$TEMP\SciTE4AutoIt3.exe" SectionEnd Section -Post SectionEnd
    1 point
  8. You have separate the gfx handle with the rotation / zoom and the background. #include <EditConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <GuiButton.au3> #include <ButtonConstants.au3> #include <File.au3> #include <Array.au3> #include <GDIPlus.au3> #include <TabConstants.au3> #include <MsgBoxConstants.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> ;~ Global Const $STM_SETIMAGE = 0x0172 Global $_CTRL_GUI, $hImage, $_External_Width, $_External_Height AutoItSetOption("GUIOnEventMode", 1) CONTROL_GUI() Func CONTROL_GUI() Local $_Play_Back, $aPlaySize, $_strip_X, $_strip_Y ; X64 running support Local $sWow64 = "" If @AutoItX64 Then $sWow64 = "\Wow6432Node" ;get AutoIt install dir Local $sRegPath = "HKLM\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt" Local $sFile = RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif" If Not FileExists($sFile) Then MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", $sFile & " not found!", 30) Exit EndIf ; Initialize GDI+ library _GDIPlus_Startup() $_CTRL_GUI = GUICreate("Positioning", 600, 350) GUISetBkColor(0xFFFFFF) ;set GUI background to 'White'... GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "_ResetGraphicsTransform") GUISetState(@SW_SHOW, $_CTRL_GUI) $aPlaySize = WinGetClientSize($_CTRL_GUI) ;get the X, Y size of the 'PLAY' GUI Window... ;**BACKGROUND IMAGE FOR "window"... $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\back_reference3.jpg") ;create the image to be watermarked... ;~ $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $_External_Height = _GDIPlus_ImageGetHeight($hImage) $_External_Width = _GDIPlus_ImageGetWidth($hImage) $_strip_X = ($aPlaySize[0] / 2) - ($_External_Width / 2) $_strip_Y = ($aPlaySize[1] / 2) - ($_External_Height / 2) $_Play_Back = GUICtrlCreatePic("", $_strip_X, $_strip_Y, $_External_Width, $_External_Height, $SS_NOTIFY) if $_Play_Back == 0 Then MsgBox(64, "Image Error:", "Problem creating desired image in 'CONTROL GUI'...error:" & @error) if $_Play_Back <> 0 Then ;~ _WinAPI_DeleteObject(GUICtrlSendMsg($_Play_Back, $STM_SETIMAGE, 0, $hHBITMAP)) ;~ _GDIPlus_ImageDispose($hImage) GuiCtrlSetState($_Play_Back, $GUI_DISABLE) GuiCtrlSetState($_Play_Back, $GUI_SHOW) EndIf ;'$_Play_Back' NOT "0" (image should have been created successfuly)... ;** ;**** ;**** Global $_adjusts = _GDIPlus_GraphicsCreateFromHWND($_CTRL_GUI) Global $hBmp_Buffer = _GDIPlus_BitmapCreateFromScan0($_External_Width, $_External_Height) Global $hGfx_Buffer = _GDIPlus_ImageGetGraphicsContext($hBmp_Buffer) Global $hImage3 = _GDIPlus_ImageLoadFromFile($sFile) Global $iMouseX, $iMouseY GUIRegisterMsg($WM_LBUTTONDOWN, "WM_LBUTTONDOWN") GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL") GUIRegisterMsg($WM_MOUSEMOVE, "WM_MOUSEMOVE") GUISetState(@SW_SHOW) _Draw() While Sleep(10) WEnd ;**** ;**** EndFunc ;"CONTROL_GUI()" updates the various controls used for image positioning as necessary... Func _ResetGraphicsTransform() _GDIPlus_GraphicsResetTransform($hGfx_Buffer) _Draw() EndFunc ;==>_ResetGraphicsTransform Func WM_LBUTTONDOWN($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam $iMouseX = BitAND($lParam, 0x0000FFFF) $iMouseY = BitShift($lParam, 16) Return $GUI_RUNDEFMSG EndFunc ;==>WM_LBUTTONDOWN Func WM_MOUSEMOVE($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg Switch BitAND($wParam, 0x0000FFFF) Case 1 Local $iX = BitAND($lParam, 0x0000FFFF) Local $iY = BitShift($lParam, 16) _GDIPlus_GraphicsTranslateTransform($hGfx_Buffer, $iX - $iMouseX, $iY - $iMouseY, True) $iMouseX = $iX $iMouseY = $iY _Draw() EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_MOUSEMOVE Func WM_MOUSEWHEEL($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $lParam Switch BitAND($wParam, 0x0000FFFF) Case 1 Local $iAngle = -3 If BitShift($wParam, 16) < 0 Then $iAngle = 3 Local $aMousePos[2][2] = [[1]] $aMousePos[1][0] = $iMouseX $aMousePos[1][1] = $iMouseY _GDIPlus_GraphicsTransformPoints($hGfx_Buffer, $aMousePos) _GDIPlus_GraphicsTranslateTransform($hGfx_Buffer, $aMousePos[1][0], $aMousePos[1][1]) _GDIPlus_GraphicsRotateTransform($hGfx_Buffer, $iAngle) _GDIPlus_GraphicsTranslateTransform($hGfx_Buffer, -$aMousePos[1][0], -$aMousePos[1][1]) Case Else Local $aInfo = GUIGetCursorInfo($_CTRL_GUI) Local $iScale = 1.1 If BitShift($wParam, 16) < 0 Then $iScale = 0.9 _GDIPlus_GraphicsTranslateTransform($hGfx_Buffer, -$aInfo[0], -$aInfo[1], True) _GDIPlus_GraphicsScaleTransform($hGfx_Buffer, $iScale, $iScale, True) _GDIPlus_GraphicsTranslateTransform($hGfx_Buffer, $aInfo[0], $aInfo[1], True) EndSwitch _Draw() Return $GUI_RUNDEFMSG EndFunc ;==>WM_MOUSEWHEEL Func _Draw() _GDIPlus_GraphicsClear($hGfx_Buffer, 0x00000000) ;****PROBLEM IS CAUSED BY REMOVING THIS 'GraphicsClear' STATEMENT...BUT HOW TO COMPENSATE THE LOSS OF THE ; BACKGROUND IMAGE...??? _GDIPlus_GraphicsDrawImage($hGfx_Buffer, $hImage3, 216, 166) Local $hPen = _GDIPlus_PenCreate(0xFFFFFFFF) _GDIPlus_GraphicsDrawRect($hGfx_Buffer, 10, 10, 200, 100, $hPen) _GDIPlus_PenDispose($hPen) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) Local $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat, 1) Local $hFamily = _GDIPlus_FontFamilyCreate("Arial") Local $hFont = _GDIPlus_FontCreate($hFamily, 24, 2) Local $tLayout = _GDIPlus_RectFCreate(0, 260, 400) _GDIPlus_GraphicsDrawStringEx($hGfx_Buffer, "AutoIt rulez!", $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_GraphicsDrawImageRect($_adjusts, $hImage, 0, 0, $_External_Width, $_External_Height) _GDIPlus_GraphicsDrawImage($_adjusts, $hBmp_Buffer, 0, 0) _GDIPlus_FontDispose($hFont) $hFont = _GDIPlus_FontCreate($hFamily, 10) _GDIPlus_StringFormatSetAlign($hFormat, 0) DllStructSetData($tLayout, "X", 10) DllStructSetData($tLayout, "Y", 10) _GDIPlus_GraphicsDrawStringEx($_adjusts, "left mousebutton = move graphic", $hFont, $tLayout, $hFormat, $hBrush) DllStructSetData($tLayout, "Y", 30) _GDIPlus_GraphicsDrawStringEx($_adjusts, "mousewheel = zoom graphic", $hFont, $tLayout, $hFormat, $hBrush) DllStructSetData($tLayout, "Y", 50) _GDIPlus_GraphicsDrawStringEx($_adjusts, "mousewheel + left mousebutton = rotate graphic", $hFont, $tLayout, $hFormat, $hBrush) DllStructSetData($tLayout, "Y", 70) _GDIPlus_GraphicsDrawStringEx($_adjusts, "right mousebutton = reset", $hFont, $tLayout, $hFormat, $hBrush) Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_GraphicsGetTransform($hGfx_Buffer, $hMatrix) Local $aMatrix_Values = _GDIPlus_MatrixGetElements($hMatrix) _GDIPlus_MatrixDispose($hMatrix) DllStructSetData($tLayout, "Y", 110) _GDIPlus_GraphicsDrawStringEx($_adjusts, "Matrix:", $hFont, $tLayout, $hFormat, $hBrush) DllStructSetData($tLayout, "X", 20) DllStructSetData($tLayout, "Y", 130) _GDIPlus_GraphicsDrawStringEx($_adjusts, StringFormat("%.2f %.2f", $aMatrix_Values[0], $aMatrix_Values[1]), $hFont, $tLayout, $hFormat, $hBrush) DllStructSetData($tLayout, "Y", 150) _GDIPlus_GraphicsDrawStringEx($_adjusts, StringFormat("%.2f %.2f", $aMatrix_Values[2], $aMatrix_Values[3]), $hFont, $tLayout, $hFormat, $hBrush) DllStructSetData($tLayout, "Y", 170) _GDIPlus_GraphicsDrawStringEx($_adjusts, StringFormat("%.2f %.2f", $aMatrix_Values[4], $aMatrix_Values[5]), $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) EndFunc ;==>_Draw Func _Exit() _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hImage3) _GDIPlus_GraphicsDispose($hGfx_Buffer) _GDIPlus_BitmapDispose($hBmp_Buffer) _GDIPlus_GraphicsDispose($_adjusts) _GDIPlus_Shutdown() GUIDelete($_CTRL_GUI) Exit EndFunc ;==>_Exit
    1 point
  9. A Beep music made by me Enjoy ! ;################################################### ; Mario Bros Theme ( Beep Music )################### ;################################################### ;###################### by J0keR ################## ;################################################### Beep(480,200); Beep(1568,200); Beep(1568,200); Beep(1568,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(783.99,200); Beep(369.99,200); Beep(392,200); Beep(369.99,200); Beep(392,200); Beep(392,400); Beep(196,400); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(83.99,200); Beep(880,200); Beep(830.61,200); Beep(880,200); Beep(987.77,400); Beep(880,200); Beep(783.99,200); Beep(698.46,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(880,200); Beep(830.61,200); Beep(880,200); Beep(987.77,400); Sleep(200); Beep(1108,10); Beep(1174.7,200); Beep(1480,10); Beep(1568,200); Sleep(200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(783.99,200); Beep(739.99,200); Beep(783.99,200); Beep(880,200); Beep(830.61,200); Beep(880,200); Beep(987.77,400); Beep(880,200); Beep(783.99,200); Beep(698.46,200); Beep(659.25,200); Beep(698.46,200); Beep(784,200); Beep(880,400); Beep(784,200); Beep(698.46,200); Beep(659.25,200); Beep(587.33,200); Beep(659.25,200); Beep(698.46,200); Beep(784,400); Beep(698.46,200); Beep(659.25,200); Beep(587.33,200); Beep(523.25,200); Beep(587.33,200); Beep(659.25,200); Beep(698.46,400); Beep(659.25,200); Beep(587.33,200); Beep(493.88,200); Beep(523.25,200); Sleep(400); Beep(349.23,400); Beep(392,200); Beep(329.63,200); Beep(523.25,200); Beep(493.88,200); Beep(466.16,200); Beep(440,200); Beep(493.88,200); Beep(523.25,200); Beep(880,200); Beep(493.88,200); Beep(880,200); Beep(1760,200); Beep(440,200); Beep(392,200); Beep(440,200); Beep(493.88,200); Beep(783.99,200); Beep(440, 200); Beep(783.99,200); Beep(1568,200); Beep(392,200); Beep(349.23,200); Beep(392,200); Beep(440,200); Beep(698.46,200); Beep(415.2,200); Beep(698.46,200); Beep(1396.92,200); Beep(349.23,200); Beep(329.63,200); Beep(311.13,200); Beep(329.63,200); Beep(659.25,200); Beep(698.46,400); Beep(783.99,400); Beep(440,200); Beep(493.88,200); Beep(523.25,200); Beep(880,200); Beep(493.88,200); Beep(880,200); Beep(1760,200); Beep(440,200); Beep(392,200); Beep(440,200); Beep(493.88,200); Beep(783.99,200); Beep(440,200); Beep(783.99,200); Beep(1568,200); Beep(392,200); Beep(349.23,200); Beep(392,200); Beep(440,00); Beep(698.46,200); Beep(659.25,200); Beep(698.46,200); Beep(739.99,200); Beep(783.99,200); Beep(392,200); Beep(392,200); Beep(392,200); Beep(392,200); Beep(196,200); Beep(196,200); Beep(196,200); Beep(185,200); Beep(196,200); Beep(185,200); Beep(196,200); Beep(207.65,200); Beep(220,200); Beep(233.08,200); Beep(246.94,200);
    1 point
  10. I would recommend using http://12noon.com/?page_id=80
    1 point
  11. Edit: Scratch that, the script works. The color was simply not being found. Thanks Yashied and Melba. #include <WinAPI.au3> #Include <WinAPIEx.au3> #include <Array.au3> $window = "[CLASS:Notepad]" $handle = WinGetHandle($window) $aWinPos = WinGetPos($handle) $hDC = _WinAPI_GetWindowDC($handle) $hMemDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $aWinPos[2], $aWinPos[3]) _WinAPI_SelectObject($hMemDC, $hBitmap) _PrintWindow($handle, $hMemDC) $lookup = _PixelSearchEx($hBitmap, 0x00FFFF) _ArrayDisplay($lookup) _WinAPI_DeleteDC($hMemDC) _WinAPI_ReleaseDC($handle, $hDC) _WinAPI_DeleteObject($hBitmap) Func _PixelSearchEx($hBitmap, $iColor) Static $pProc = 0 If Not $pProc Then If @AutoItX64 Then ; Not implemented! Return SetError(1, 0, 0) Else $pProc = __Init(Binary( _ '0x5553575631C0505050837C24280074118B6C2428837D14007407B801000000EB' & _ '0231C021C0747F8B6C24288B5D084B891C2431C03B04247F6DC7442404000000' & _ '008B6C24288B5D044B3B5C24047C528B6C24288B5D148B7C24048B34248B6C24' & _ '280FAF750401F7C1E70201FB895C24088B6C24088B5D0081E3FFFFFF003B5C24' & _ '2475188B5C24048B6C24288B7D082B3C244FC1E71009FB89D8EB14FF44240471' & _ 'A0FF0C24718CB8FFFFFFFFEB0231C083C40C5E5F5B5DC21000')) EndIf EndIf Local $tDIB, $tInt, $tPos, $aPos, $Ret, $Error = True $hBitmap = _WinAPI_CopyBitmap($hBitmap) If @error Then Return SetError(1, 0, 0) EndIf Do $tDIB = DllStructCreate($tagDIBSECTION) If (Not _WinAPI_GetObject($hBitmap, DllStructGetSize($tDIB), DllStructGetPtr($tDIB))) Or (DllStructGetData($tDIB, 'bmBitsPixel') <> 32) Or (DllStructGetData($tDIB, 'biCompression')) Then ExitLoop EndIf $Ret = _WinAPI_CallWindowProc($pProc, 0, $iColor, DllStructGetPtr($tDIB), 0) If (@error) Or ($Ret = -1) Then ExitLoop EndIf $Error = False Until 1 _WinAPI_DeleteObject($hBitmap) If $Error Then Return SetError(1, 0, 0) EndIf $tInt = DllStructCreate('int') $tPos = DllStructCreate('ushort;ushort', DllStructGetPtr($tInt)) DllStructSetData($tInt, 1, $Ret) Dim $aPos[2] For $i = 0 To 1 $aPos[$i] = DllStructGetData($tPos, $i + 1) Next Return $aPos EndFunc ;==>_PixelSearchEx Func _PrintWindow($hWnd, $hMemDC, $iFlag = 0) $aRet = DllCall("User32.dll", "int", "PrintWindow", _ "hwnd", $hWnd, _ "hwnd", $hMemDC, _ "int", $iFlag) Return $aRet[0] EndFunc ;==>_PrintWindow
    1 point
×
×
  • Create New...