#157010 - 2006-02-10 10:43 AM
Scripting GUIDGen.exe
|
Mart
KiX Supporter
Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
|
Guy's,
I started messing around with a script that creates buttons and/or menu items in IE. MS has a tutorial on this. In the tutorial the GUIDGen.exe tool is used to create a GUID. Is it possible to script the workings of GUIDGen.exe? All other stuff is just simple registry writes but a new GUID is needed before any registry writes can be done. Never did anything with calling an API from a script so I have no idea where to start.
Adding Toolbar Buttons to IE Adding Menu Items to IE Get GUIDGen.exe here
A registry suitable GUID to use within kix is what I'm looking for.
A quote from the readme included in the download.
Quote:
The GUID Generator component lets you generate globally unique identifiers, or GUIDs, that you can use to identify your Microsoft® ActiveX® classes, objects, and interfaces. GUIDGen does this by calling the CoCreateGuid application programming interface (API) function to generate a new GUID. The resulting GUID is copied to the Clipboard in one of four formats for insertion into your application’s source code.
The four formats are: •Defined in an IMPLEMENT_OLECREATE macro, which allows instances of a CCmdTarget-derived class to be created by Automation clients. For example: // {CA761230-ED42-11CE-BACD-00AA0057B223} IMPLEMENT_OLECREATE(<>, <>, 0xca761230, 0xed42, 0x11ce, 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2, 0x23);
•Defined using the DEFINE_GUID macro, which is commonly used in programming that does not use Microsoft Foundation Classes (MFC). For example: // {CA761231-ED42-11CE-BACD-00AA0057B223} DEFINE_GUID(<>, 0xca761231, 0xed42, 0x11ce, 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2, 0x23);
•Declared as a statically allocated structure. For example: // {CA761232-ED42-11CE-BACD-00AA0057B223} static const GUID <> = { 0xca761232, 0xed42, 0x11ce, { 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2, 0x23 } };
•Specified in a form suitable for registry entries or Registry Editor scripts. For example: {CA761233-ED42-11CE-BACD-00AA0057B223}
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.
|
Top
|
|
|
|
#157011 - 2006-02-10 11:12 AM
Re: Scripting GUIDGen.exe
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
What you actually want to script is this:
Quote:
GUIDGen does this by calling the CoCreateGuid application programming interface (API) function to generate a new GUID
This API is not part of GUIDGen - GUIDGen is just a wrapper exe to allow you to call the API.
If you search around for scripts which call coCreateGUID you should be able to find something that you can convert or use directly.
If not, post again.
|
Top
|
|
|
|
#157013 - 2006-02-10 11:49 AM
Re: Scripting GUIDGen.exe
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
There is a free GUID generator called GUIDMaker which has a scriptable component available here: http://www.serverobjects.com/products.htm
Download the small zip, extract the DLL, copy to your system32 directory and register it.
Once you've done that you can issue GUIDs to your heart's content.
Here's one I prepared earlier: Code:
$sGUID=CreateObject("GuidMakr.GUID").GetGUID "GUID="+$sGUID+@CRLF
Output:
Quote:
GUID={BA456FCA-FC6F-45D4-A72B-2C9DFAF07E89}
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 248 anonymous users online.
|
|
|