Search found 185 matches

by GEOVAN
24 May 2024, 04:09
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

I see.... Thank you very much! With your help i finally i end up with the following final code: Is this final code ALL completely correct, please? Final code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; F2:: ; press F2 to save screenshot as .b...
by GEOVAN
23 May 2024, 23:50
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Does your above comment valid in any case? Yes, the correct data types must always be specified when calling DllCall() , regardless of where that call is located. So, regarding the Example - Code in my previous comment, where its TWO functions (1) GDI_CaptureScreen, and (2) ImageToClipboard have "N...
by GEOVAN
23 May 2024, 13:57
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Thank you very much! Please let me clarify a last point regarding your comment : There is no difference in using "Ptr" inside or outside functions. With handles and pointers you must always use "Ptr". So the correct option is to always use "Ptr": DllCall("DeleteObject", "Ptr", hbm) Does your above c...
by GEOVAN
18 May 2024, 05:23
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Thank you for your comments regarding "Ptr" and "UPtr" and "Int" and "Uint", and for the link: https://www.autohotkey.com/docs/v1/lib/DllCall.htm#unsigned From that link, it is documented the following: "Ptr" is ..... equivalent to Int or Int64 depending on whether the exe running the script is 32-b...
by GEOVAN
17 May 2024, 12:43
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Dear teadrinker, i want to say a BIG THANK YOU to you! You help me so much. THANK YOU!!! :superhappy: I know that this may be little different topic, but i kindly request a last point regarding the "Ptr" and "UPtr" and "Int" and "Uint" used in the "DllCall("DeleteObject" ...." , because i think you ...
by GEOVAN
17 May 2024, 12:32
Forum: Ask for Help (v1)
Topic: Functions and RETURN
Replies: 7
Views: 762

Re: Functions and RETURN

Thank you very very much!!!
by GEOVAN
16 May 2024, 14:06
Forum: Ask for Help (v1)
Topic: Functions and RETURN
Replies: 7
Views: 762

Re: Functions and RETURN

Thank you so much! You help me understand Functions and RETURN. Just please let me know a minor but significant clarification: Speaking for cases of functions where NO returning a value to the caller , as for general example, below: ; Here is the FUNCTION: Function_Example( X, Y, W, H) { ....some co...
by GEOVAN
15 May 2024, 13:26
Forum: Ask for Help (v1)
Topic: Functions and RETURN
Replies: 7
Views: 762

Re: Functions and RETURN

A Return statement is not required for a function unless you are returning a value to the caller, for example: #Requires AutoHotkey v1.1.33+ MsgBox % Sum(5,9) Exitapp Sum(a,b) { c := a + b Return % c } or #Requires AutoHotkey v1.1.33+ MsgBox % Sum(5,9) Exitapp Sum(a,b) { Return (a + b) } Russ Thank...
by GEOVAN
15 May 2024, 10:59
Forum: Ask for Help (v1)
Topic: Functions and RETURN
Replies: 7
Views: 762

Functions and RETURN

Lets say we have a script that uses a function. Do we need at the end of the function to add a RETURN, or since it is a function, it automatically return without need to add a return? If we add a return is wrong or is better, please? Example: F3:: ; press F3 to load screenshot to clipboard GDI_Captu...
by GEOVAN
14 May 2024, 10:50
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Dear teadrinker, Thank you very very much for your answers regarding the TWO codes , CODE 1 and CODE 2, i was referring which are the following: Note: The only difference between CODE 1 and CODE 2 is the following: Under SaveToImageFile FUNCTION, we substitute the variable name hBitmap to hBM , and ...
by GEOVAN
12 May 2024, 13:06
Forum: Ask for Help (v1)
Topic: Question regarding "Ptr" and "UPtr" and "Int" and "Uint"
Replies: 0
Views: 306

Question regarding "Ptr" and "UPtr" and "Int" and "Uint"

Question regarding "Ptr" and "UPtr" and "Int" and "Uint" From my reading i understand that the best to use is the "Ptr", because it covers all the rest ("UPtr" and "Int" and "Uint") For example purposes, lets consider the following function: ImageToClipboard(Filename) { hbm := DllCall("LoadImage","u...
by GEOVAN
11 May 2024, 07:11
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Dear teadrinker, Thank you very very much! Sorry, i am little confused regarding "DeleteObject", and i will kindly request to discuss the following TWO questions, please: Question 1 I observe that some functions use the following "DeleteObject": DllCall("DeleteObject", "Ptr", hBM) ; Clean-up If we d...
by GEOVAN
08 May 2024, 23:07
Forum: Ask for Help (v1)
Topic: GDI_CaptureScreen to Clipboard
Replies: 7
Views: 1037

Re: GDI_CaptureScreen to Clipboard

Hello,
Please you can see the following topic: (many thanks to @teadrinker)
viewtopic.php?f=76&t=94345&p=571071#p571071
by GEOVAN
08 May 2024, 22:57
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Thank you very very much!!! I appreciate your help. With your help, and from a topic at https://www.autohotkey.com/boards/viewtopic.php?t=129501 i ended up with the following code: F2:: ; press F2 to save screenshot hBM := "" hBM := GDI_CaptureScreen( 0, 0, A_ScreenWidth, A_ScreenHeight ) SaveToImag...
by GEOVAN
08 May 2024, 15:20
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 89
Views: 13801

Re: How to save image in clipboard.

Dear teadrinker, please let me further ask: If i want to add ---> DllCall("DeleteObject", "Ptr", hBM) ; Clean-up I modify "little" your code as follow: F2:: ; press F2 to save screenshot hBM := "" hBM := GDI_CaptureScreen( 0, 0, A_ScreenWidth, A_ScreenHeight ) SaveToImageFile(hBM, A_ScriptDir . "\Cl...
by GEOVAN
08 May 2024, 13:51
Forum: Ask for Help (v1)
Topic: Question regarding --> DllCall("DeleteObject", "Ptr", hBM)
Replies: 6
Views: 845

Re: Question regarding --> DllCall("DeleteObject", "Ptr", hBM)

Thank you, you are right, may be is not needed at all to add the line --> DllCall("DeleteObject", "Ptr", hBM) But if i want to add it, i can do it NOT inside the functions, but after i call the function, for example: hBM := GDI_CaptureScreen( 0, 0, A_ScreenWidth, A_ScreenHeight ) GDI_SaveBitmap( hBM...
by GEOVAN
08 May 2024, 12:49
Forum: Ask for Help (v1)
Topic: Question regarding --> DllCall("DeleteObject", "Ptr", hBM)
Replies: 6
Views: 845

Re: Question regarding --> DllCall("DeleteObject", "Ptr", hBM)

Thank you, i did not know that regarding inside a function, thanks.
So, where i can locate the --> DllCall("DeleteObject", "Ptr", hBM) inside the 2 example functions ?
If i locate it JUST BEFORE the RETURN line, it may not work as expected due to the previous IF ?
Please i will appreciate your help.
by GEOVAN
08 May 2024, 12:35
Forum: Ask for Help (v1)
Topic: Question regarding --> DllCall("DeleteObject", "Ptr", hBM)
Replies: 6
Views: 845

Question regarding --> DllCall("DeleteObject", "Ptr", hBM)

Hello, Question regarding --> DllCall("DeleteObject", "Ptr", hBM) ; Clean-up Please let me ask: If i use the --> DllCall("DeleteObject", "Ptr", hBM) ; Clean-up --> add the very end of a function AFTER return , for example: Example 1: GDI_CaptureScreen( X, Y, W, H, ByRef Checksum="" ) { tDC := DllCal...
by GEOVAN
07 May 2024, 12:13
Forum: Ask for Help (v1)
Topic: How can we go back to DEFAULT Coordmode mode?
Replies: 4
Views: 506

Re: How can we go back to DEFAULT Coordmode mode?

Thank you very much, So: CoordMode, Mouse ,Screen MouseGetPos, MX, MY ....SOME CODE...... CoordMode, Mouse ,Window The last line --> CoordMode, Mouse ,Window ---> will force the SCRIPT to go back to DEFAULT state, that is to the state it was before using the CoordMode, Mouse ,Screen But, in a case i...

Go to advanced search