Jump to content

Calling Icon Editor programmatically


Recommended Posts

mballa's post on the property page reminded me of something I was trying to do a while back, which is to invoke the icon editor programmatically.

Has anyone looked into calling the built in icon editor programmatically? I was working on an Icon Editor and I couldn't figure out how to call the built in editor.

If I used a custom icon editor for LV 8+ which replaces the built-in editor, I also had a problem figuring out which VI had invoked the icon editor. I was trying to use the VI name to auto-generate some text for the icon, but I could not get the name or reference of the VI that called the Icon Editor. I tried the front-most property, but the icon editor was already frontmost from the get go. I tried some scripting properties like "Active VI" and "MenuLaunchVI" but also to no avail. Is this a purposeful roadblock or what?

David

Link to comment

QUOTE(dsaunders @ Apr 12 2007, 11:06 AM)

mballa's post on the property page reminded me of something I was trying to do a while back, which is to invoke the icon editor programmatically.

Has anyone looked into calling the built in icon editor programmatically? I was working on an Icon Editor and I couldn't figure out how to call the built in editor.

If I used a custom icon editor for LV 8+ which replaces the built-in editor, I also had a problem figuring out which VI had invoked the icon editor. I was trying to use the VI name to auto-generate some text for the icon, but I could not get the name or reference of the VI that called the Icon Editor. I tried the front-most property, but the icon editor was already frontmost from the get go. I tried some scripting properties like "Active VI" and "MenuLaunchVI" but also to no avail. Is this a purposeful roadblock or what?

David

App.User Interaction:Edit Icon is what you're looking for, just be sure to pass in valid icon data into "Color 256" or else it won't open.

Attached VI works in LabVIEW 8.0 (and above, I assume).

Link to comment

QUOTE(AdamRofer @ Apr 12 2007, 02:01 PM)

App.User Interaction:Edit Icon is what you're looking for, just be sure to pass in valid icon data into "Color 256" or else it won't open.

Attached VI works in LabVIEW 8.0 (and above, I assume).

I will try this out. Thanks!!

Link to comment
  • 1 month later...

QUOTE(dsaunders @ Apr 12 2007, 11:06 AM)

If I used a custom icon editor for LV 8+ which replaces the built-in editor, I also had a problem figuring out which VI had invoked the icon editor. I was trying to use the VI name to auto-generate some text for the icon, but I could not get the name or reference of the VI that called the Icon Editor. I tried the front-most property, but the icon editor was already frontmost from the get go. I tried some scripting properties like "Active VI" and "MenuLaunchVI" but also to no avail. Is this a purposeful roadblock or what?

I was playing around with this today, and finally hacked something together to determine what VI called the LV 8.x replacement Icon Editor. The trick is to momentarily set the state of the Icon Editor VI to 'Hidden', then check for the frontmost VI, then restore the Icon Editor VI to the 'Standard' state.

Finding the frontmost VI requires using the "VIMemory Get VIs in Memory.vi" tool that is in the 8.x directory (<LV dir>\vi.lib\Utility\allVIsInMemory.llb\VIMemory Get VIs in Memory.vi). This checks for VIs in all the application references, not just the one you're in.

It may not be pretty, but I'll take what they give me.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.