Page 1 of 1

Gdip not working anymore (Win10)

Posted: 19 Mar 2019, 10:12
by Scr1pter
Hi guys,

I've been using Windows 10 Pro 64 Bit for a few days.
(Installed a new SSD and used my Win7 key during the Win10 setup - fresh install)
Most AHK scripts, which I've tested, seem to work.
(I haven't tested everything yet.)

However, for unknown reason no gdip scripts work anymore.
E.g. painting lines on the screen | creating a printscreen | saving as a file etc.

These two scripts for example don't work anymore:

Code: Select all

#SingleInstance, force ; Nur eine Instanz erlauben und laufende Instanzen überschreiben
#include Gdip.ahk ; Gdip-Bibliothek einbinden

;Create printscreen and save it as file
F5::
datei = C:\Users\USER\Documents\Logitech Gaming Software\Profil-Screenshots\test.png
pToken := Gdip_Startup() ; Gdip-Instanz starten
WinGetPos, x, y, w, h, A ; Abmessung und Position des aktuellen Fensters ermitteln
pBitmap := Gdip_BitmapFromScreen(x "|" y "|" w "|" h) ; Bildschirmfoto anhand der ermittelten Werte erstellen 
Gdip_SaveBitmapToFile(pBitmap, datei) ; Bild aus Zwischenlage in dem angegebenen Verzeichnis erstellen
Gdip_DisposeImage(pBitmap) ; Grafiken aus Speicher entfernen
Gdip_Shutdown(pToken) ; Gdip-Instanz schließen
return

;Create printscreen (same as Alt+PrntScr)
F2::
pToken := Gdip_Startup() ; Gdip-Instanz starten
WinGetPos, x, y, w, h, A ; Abmessung und Position des aktuellen Fensters ermitteln
pBitmap := Gdip_BitmapFromScreen(x "|" y "|" w "|" h) ; Bildschirmfoto anhand der ermittelten Werte erstellen 
Gdip_SetBitmapToClipboard(pBitmap) ; Aufgenommenes Bild an die Zwischenablage senden
Gdip_DisposeImage(pBitmap) ; Grafiken aus Speicher entfernen
Gdip_Shutdown(pToken) ; Gdip-Instanz schließen
return
Also the default gdip script which paints rectangles (gdip-draw-line.ahk) doesn't paint anything.

Inside of my AHK script folder there's both the gdiplus.dll (31.08.2018) and the Gdip.ahk (standard lib v1.45 by tic (Tariq Porter) 07/09/11)
I get no error messages and didn't change anything since I copied and pasted the whole AHK script folder (from Win7 to ext HDD to Win10).
My AHK version is the same as it was on Windows 7 (1.1.29.0)

What could be the problem?
Thanks for any help!

Cheers!

Re: Gdip not working anymore (Win10)

Posted: 19 Mar 2019, 10:20
by nnnik
You probably switched from AHK 64 to AHK 32 bit.
generally the Gdip standard library does not support 64 bit AHK and you need to use a version of the script that supports the script.

Re: Gdip not working anymore (Win10)

Posted: 19 Mar 2019, 10:39
by Scr1pter
Thanks for the reply.

I've just assigned all ahk files to be opened/executed with AutoHotkeyU32.exe.
Now it works, but I'm 99% sure that I always worked with AutoHotkeyU64.exe under Windows 7.
Strange...

I mean if I won't "feel" any difference, it's fine for me to work with AHK 32 bit...

Cheers!

Re: Gdip not working anymore (Win10)  Topic is solved

Posted: 19 Mar 2019, 11:33
by nnnik
Yeah when something goes wrog there is no guarantee that the error will cause issues.
But that might change once you change the circumstances of your script - like you did when you switched from Win 7 to Win 10.
Btw if you look at the Gdip topic you will see that there is a download for GDI+ all that supports all AHK versions.
I would reccomend to just use that instead of Gdip.

Re: Gdip not working anymore (Win10)

Posted: 19 Mar 2019, 12:01
by Scr1pter
Ok great, I downloadeded Gdip_All.ahk from here and now it works perfectly.
https://www.autohotkey.com/boards/viewtopic.php?t=6517
https://www.dropbox.com/s/0e9gdfetbfa8v0o/Gdip_All.ahk

Thanks!