Jump to content
Sign in to follow this  
WhOOt

Need help - Dont know how to expain

Recommended Posts

Heyya!

I'm Making this program, that saves screenshots at a temp place, and copies it to C:\Screenshots\

Now i need to know, how to clipput the Screenshot(.jpg file) to the clipboard..

Heres the code, if it helps any

while 1
    hotkeyset("^f", "_capture")
    hotkeyset("^d", "_captureclip")
    sleep(50)
    wend
func _capture()
$number = iniread("C:\Screenshots\ini.ini", "ini", "ini", "")
if @error then _error()
; Capture full screen

; Fist parameter - filename, last - jpeg quality. 
DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85)
dircreate("C:\Screenshots")
filemove("dump_full.jpg", "C:\Screenshots\Screenshot" & $number & ".jpg")
$number = $number + 1
iniwrite("C:\Screenshots\ini.ini", "ini", "ini", $number)
endfunc


Func _captureclip()
    $number = iniread("C:\Screenshots\ini.ini", "ini", "ini", "")
    $number = $number - 1
    $file = "C:\Screenshots\Screenshot" & $number
    clipput($file)
EndFunc


func _error()
    if not fileexists("C:\Screenshots\ini.ini") Then
    iniwrite("C:\Screenshots\ini.ini", "ini", "ini", "1")
    endif
    endfunc

The problem is, that $file is letters, not a file.... :)

~WhOOt

Share this post


Link to post
Share on other sites

Post your C:\Screenshots\ini.ini.

Maybe missing backslash in:

$file = "C:\Screenshots\Screenshot" & $number

Share this post


Link to post
Share on other sites

for only one screen you can use printscreen or alt-printscreen which copy the screen or the active window to the clipboard and you can open Paint paste and save in .jpg format to reduce the size :)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...