JDave Posted April 13, 2007 Report Share Posted April 13, 2007 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 Quote Link to comment
AdamRofer Posted April 13, 2007 Report Share Posted April 13, 2007 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). Quote Link to comment
JDave Posted April 13, 2007 Author Report Share Posted April 13, 2007 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!! Quote Link to comment
JDave Posted June 7, 2007 Author Report Share Posted June 7, 2007 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.