Jump to content
Sign in to follow this  

DllCall or captdll.dllProblem

Recommended Posts


Unusual problem, have spent about a day on this.

Code below maxmises the IE window, gets its dimensions, fires a msgbox (doesnt have to be there but part of my error checking) then captures the IE window and saves it to the desktop.

This is all fine. :rambo:

However nothing that comes next in the code works, no error (>Exit code: 0 Time: 28.643), just exit. The MsgBox(0, "Title 2", "check for file 2") is not called nor anything that I put after the DllCall. :rolleyes:

I am sure I am overlooking something very obvious, thanks all the same!

Code below:


WinSetState("TITLE - Microsoft Internet Explorer", "", @SW_MAXIMIZE)

Local $Cwin1 = WinGetHandle(""); gets the handle of the active window

Local $Cwin2 = WinGetPos($Cwin1); gets active window dimensions

MsgBox(0, "Title 1", "check for file 1")

$fileMoniker = "ABC_123.jpg"

$dllCap = DllOpen(@ScriptDir & "\captdll.dll") ;this dll is in the same file as the script

DllCall($dllCap, "int", "CaptureRegion", "str", "C:\Documents and Settings\jezandrews\Desktop\" & $fileMoniker, "int", $Cwin2[0], "int", $Cwin2[1], "int", $Cwin2[2], "int", $Cwin2[3], "int", 85)

DllClose($dllCap); realise that some documentation says dll open/close can be redundant if you use dllcall to overcome have tried both methods

MsgBox(0, "Title 2", "check for file 2") ; this (or any other code here) is never executed!

Share this post

Link to post
Share on other sites

Try putting DllCall second parameter "int:cdecl".

Share this post

Link to post
Share on other sites

You sir are a prince amongst men, a king amongst princes and a god among mortals!

Thank you. :rolleyes:

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.