Yep, as long as you wait for the AutoIt script to complete so that the iGuidance map window is visable before you embed it, then it is embedded, positioned, and sized perfectly everytime.
I added this code to the above procedure which make it automatically extract parameters from the CommandLine variable:
Code:
CLParams: String;
PrevSpaceIndex: Integer;
begin
CLParams := '';
while not(FileExists(CommandLine)) and (pos(' ', CommandLine) > 0) do
begin
PrevSpaceIndex := pos(' ', CommandLine);
while (pos(' ', copy(CommandLine, PrevSpaceIndex + 1, length(CommandLine))) > 0) do
PrevSpaceIndex := PrevSpaceIndex + pos(' ', copy(CommandLine, PrevSpaceIndex + 1, length(CommandLine)));
CLParams := copy(CommandLine, PrevSpaceIndex + 1, length(CommandLine)) + ' ' + CLParams;
CommandLine := copy(CommandLine, 1, PrevSpaceIndex - 1);
end;
if (CLParams <> '') then
begin
CLParams := copy(CLParams, 1, length(CLParams) - 1);
if not(FileExists(CommandLine)) then
begin
CommandLine := CommandLine + ' ' + CLParams;
CLParams := '';
end;
end;
The only drawback is that if you do use CommandLine parameters, you also have to have the full path ("explorer.exe" will work, and "c:\windows\explorer.exe c:\" will work, but "explorer.exe c:\" would not work). I can live with that.
EDIT: Since I am now using ShellExecuteEX, you can run .au3's or any file with a shell association now too. Yay! Now that I have the embedding down, I am ready to get back in to button-code. I'm finally making progress with V3. This will be soooo much better than the previous SKINbedder versions!!!
PS: I'm still looking for a SKIN artist to work with if we are going to release V3 with all the iG sub-menus pre-SKINNED.
Bookmarks