Search found 17 matches

by Rollo007
17 May 2021, 16:32
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

I thought this too, but since I'v been using this, windows refuses to delete the file which was used to load the image.
So I'm seeking for the problem and thought maybe I have to free it separately. Will go on for some try.
by Rollo007
17 May 2021, 15:51
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

OMG
Unbelievable, but I've just overlooked this. :facepalm:

Okay, your code were perfect.

Just one more question:
I tried to free the image like

Code: Select all

e:= DllCall("DeleteObject", "Ptr", hLogo)
but it do not work. (e = 0)
by Rollo007
17 May 2021, 14:46
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

Ha ha nooo -it was not a misunderstanding by me. :D The misunderstanding was that you thought I mentioned FreeLibrary regarding GetModuleHandle, BUT I wrote it regarding the LoadLibraryEx function. And the LoadLibraryEx do incrementing the reference counter. So it is necessary to call a FreeLibrary ...
by Rollo007
17 May 2021, 14:03
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

Missunderstanding. I wrote this regarding the LoadLibraryEx function
by Rollo007
17 May 2021, 12:39
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

I guess it would be necessary to add a

Code: Select all

DllCall("FreeLibrary", "Ptr", hModule)
after the LoadImage.
What do you think?
by Rollo007
17 May 2021, 07:15
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

You are FANTASTIC !!

Thanks so much.
by Rollo007
16 May 2021, 21:35
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

I thought similar fist, but the "6 or higher" makes me wondering.

Do you know a way how to access the bmp if the module is not loaded? (by another compiled script for example)
by Rollo007
16 May 2021, 16:30
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

Try this: hModule := DllCall("GetModuleHandle", "Str", A_ScriptFullPath, "Ptr") hBitmap := DllCall("LoadImage", "Ptr", hModule, "Str", "LOGO1", "UInt", 0, "Int", 0, "Int", 0, "UInt", 0, "Ptr") Thanks so much Teadrinker, it works perfect. What is about the first answer from Ecimeric? Just bullshit?
by Rollo007
16 May 2021, 09:53
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

Code: Select all

;@Ahk2Exe-AddResource C:\Program Files\MyApp\Logo.bmp, LOGO1
I have checked that the size of the exe is growing similar to the size of the bmp. So adding the bmp-resource should work fine.
by Rollo007
16 May 2021, 08:04
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

Re: AddResource and how to access it?

Thanks for your support, but it do not work. Cause of the "% " I guessed it would work directly (without a handle) like Gui, Add, Picture, w500 h-1, % A_ScriptFullPath, 6 Then I tried with LogoHandle := LoadPicture( A_ScriptFullPath, "6") (which I had tried before already) But all those code only sh...
by Rollo007
15 May 2021, 18:58
Forum: Ask for Help (v1)
Topic: AddResource and how to access it?
Replies: 21
Views: 1909

AddResource and how to access it?

Hey,
can anybody tell me how to access a resource which was added to the compiled exe via AddResource, especially if it is a bitmap picture but not a icon?
(Have tried a million ways with "LoadPicture")

Thanks in advance.

Kind Regards
Rolo
by Rollo007
13 May 2021, 12:53
Forum: Bug Reports
Topic: gui button looses default status after reactivating Topic is solved
Replies: 11
Views: 1250

Re: gui button looses default status after reactivating Topic is solved

Okay, - I had waited a bit if you say something to the other topic, but it seems you don't want to.
Anyway, I do have some suggestions and maybe bugs. Should we write about right here or do you want me to open a new thread for each?

Kind Regards
Roland
by Rollo007
03 May 2021, 12:43
Forum: Bug Reports
Topic: gui button looses default status after reactivating Topic is solved
Replies: 11
Views: 1250

Re: gui button looses default status after reactivating Topic is solved

The focus has to be placed somewhere when the window initially gains focus , and it might make sense to choose the default button for that, which I think is what you're really asking for. That's right. I understand your arguments. In fact, this example I showed you (with the inconsistent status) is...
by Rollo007
01 May 2021, 06:07
Forum: Bug Reports
Topic: gui button looses default status after reactivating Topic is solved
Replies: 11
Views: 1250

Re: gui button looses default status after reactivating Topic is solved

Sorry Steve, English is not my mother language and maybe I misunderstood you. I try to bring it to a point. Usually, if a button is set to default, it automatically gets the keyboard focus (is focused). This is working korrekt on the MsgBox or InputBox. But it is not working on Gui buttons. There, i...
by Rollo007
28 Apr 2021, 08:27
Forum: Bug Reports
Topic: gui button looses default status after reactivating Topic is solved
Replies: 11
Views: 1250

Re: gui button looses default status after reactivating Topic is solved

It is standard dialog behaviour for a button to become the "default" while it is focused, so that pressing Enter activates the focused button, not the original default button. Since you have not provided any code demonstrating the issue, I am going to assume that the button is merely being focused,...
by Rollo007
27 Apr 2021, 13:47
Forum: Bug Reports
Topic: gui button looses default status after reactivating Topic is solved
Replies: 11
Views: 1250

gui button looses default status after reactivating Topic is solved

With the option "Default" you can determine whether a button should have the default status. However: If the window loses focus, the first button in the window receives the default status when it is activated again, even if another button only has this option.

Go to advanced search