Jump to content

Recommended Posts

Posted (edited)

I'm trying to make a program to run with Windows Journal in order to select it's colors by hotkey. I've gotten most of the script finished and working. I'm just now making a GUI for it. I've found that it does indeed use an imagelist for the images of the colors displayed. I want to use that exact image list in my GUI for a more user-friendly appearance. My problem is that I am not able to grab it and use it. I've tried copying it as well and to no avail. I think it's probably due to the fact that my application does not have the appropriate privileges to access that programs resources.

My script is this (and many variations of this)

$hWnd = ControlGetHandle("[CLASS:JournalApp]", "", 113) ;113 is the control ID for the color selecting toolbar
$hImageJS = _GUICtrlToolbar_GetImageList($hWnd)  
$hImage = _GUIImageList_Duplicate($hImageJS)
ConsoleWrite(_GUIImageList_GetImageCount($hImage)&"<--count")

I know that there is an image list as I have found that I get returns that would support this idea from with GUICtrlToolbar_GetButtonImage($hWnd, $cmdId)

I always get 0 from the imagecount. I've tried various approaches, such as accessing it directly and to no avail. Any ideas/suggestions/comments?

Edited by crislivinitup
Posted

I'm having deja vu, because I thought you already bumped today?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

We say 24 hours, so no it wasn't, but deleting your message and then re-bumping is.

How do you add the resources to your application?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

I don't understand your question? I'm trying to hijack the imagelist for the ToolBarWin32 from Windows Journal to use in my application. I have tried to do this and it has not worked. I have tried getting the handle of the imagelist directly from MSJournal and I can do this, but when I try to use the imagelist in my own GUI it does not work. I have also tried copying the imagelist with _GUIImageList_Duplicate($hImageJS), but _GUIImageList_GetImageCount($hImage) returns a count of 0. But I'm sure this is the correct handle as I've used `GUICtrlToolbar_GetButtonImage($hWnd, $cmdId)` and I have found each button has it's own corresponding image index.

So I figured that I just don't have the proper rights for access. I'm not sure why this is happening.

 

By the way, I noticed you were the one who made SciTe Jump. I love using that to navigate through my code. It's very useful, just saying.

Edited by crislivinitup
Posted
  On 6/9/2013 at 7:31 PM, crislivinitup said:

By the way, I noticed you were the one who made SciTe Jump. I love using that to navigate through my code. It's very useful, just saying.

Thanks.

From my understanding what you're trying to do, can't be done. You would need to extract the resources from the executable that way and build into your application.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Fair enough. Just out of curiosity, as it is a good lesson for me, why is it that it cannot be done? Is it priviledge rights? I mean I can get the handle of the imagelist, I can see it's there.

Posted

That's a handle to the control, not the imagelist. An imagelist is created by the calling process i.e. your executable.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I thought this got me the image list...

$hWnd = ControlGetHandle("[CLASS:JournalApp]", "", 113) ;113 is the control ID for the color selecting toolbar
$hImageJS = _GUICtrlToolbar_GetImageList($hWnd)

I haven't checked if the handle is different, I just assumed that it was different from the handle of the control.

Posted

No, that hwnd is for _GUICtrlToolbar_Create.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I gave you a clue as to a work around, look at the image list examples that use shell32.dll for using resources in a dll or exe.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
×
×
  • Create New...